-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix css being versioned, rename to custom.css.sample #1540
Conversation
Hi, not sure what the issue is, since the current situation has never changed and I never got any git issues (neither did I get any reports about this in the past.) Could you elaborate on the issue? |
If I modify |
That's weird. I've changed the custom.css as well and don't get the git warning. We might want to check on the forum if more users are experiencing this issue. |
I've check about this thing time ago https://forum.magicmirror.builders/topic/1508/custom-css The really problem can be is for new updates the users with changes in own custom.css can be a completly issue here with this change. |
Yup that was the issue I was noticing. Also, if I make a PR to the MM repo, I can't just do |
So, I'm not sure what to do with this pr. It seems I'm getting mixed feedback on what happens whenever custom.css was changed. I modified the file on my own installation and never have any git issues. Can anyone please explain in detail what happens and how this produces any problems? It seems I'm not getting it ... 🙃 |
I wonder if you have excluded that file from being further tracked (with something similar to https://stackoverflow.com/a/39776107/2303432). Try running In my own MM, if I modify the file and then run |
@amcolash maybe your system is having problems interpreting the gitignore file.
Can you try to remove the leading / before css and commit the gitignore. Check afterwards if |
Hi @amcolash, it seems you are right. Changes are noted in git status. Your solution seems ok, but I have two issues:
|
|
It's probabl worth it investigating upfront why the gitignore rule is not working in the first place |
It's not working since the css file was added before the ignore file I would assume - Per git docs: |
|
Anyone know if there is a way to remove |
@MichMich I think what you're looking for is the
From the documentation:
Here's the interesting part:
This means that those who have the The downside is that the I hope this helps. |
Hi @ecampidoglio thanks for your suggestion. I really hope we can find a solution which doesn't require any user to run additional commands. But I'm afraid this is probably impossible. If we do expect users to run commands, it might be better to completely remove custom.css from the git history renaming the file to the In that case users need to backup their |
better to phase out the single file and migrate module css changes to their own file. the module loader could also load the 'modulename.css' in the module folder (just picking a predefined name). so no module code would have to be changed |
the custom.css is not specifically designed for changing modules. It's to allow users to change the look and feel of their mirror. IE: adding a background image, changing the paddings, changing font sizes, etc. |
Correct. One thing worth point out is that, since the You can do that by using the
Note that the documentation will tell you this:
Which can be a little misleading — it is true that running this command won't remove the file from the working directory; however, it will be removed from the working directory of whoever pulls the commit. Hence, those who wish to keep their local modifications, should create a copy of it prior to pulling, as you said. |
@ecampidoglio, thanks! I think this is the direction we should go. But it might be a good idea to think of a solution that prevents accidental deletion of the file.
Any other idea, anyone? Preferably as simple as possible. |
run update seems a good choice, as it could also look for modules that that need refreshing, and upgrade them (npm install, not git pull) ... seems this is a constant problem for users.. |
The only issue is that if a user does |
you should change the name, so the git pull doersn't overlay, and add code to rename it |
Not sure if that will work, since we still need to remove custom.css from the git repo. |
You should rename custom.css to something like custom.css.sample (which causes git to untrack custom.css) and have run-start.sh create/copy it if it's absent, that's all. |
@mrvanes This get a good point. I think we need a migration plan (pain). First add Warning if the file is tracking in the current local repository and give some instructions to keep out from there (locally) and keep this behavior almost one release more, also run-start-sh could do this work. After this merge this change into the current master. @MichMich if this is good for you, I'll could to it. |
@roramirez Yes, feel free to send a pr which does the first step (in 2.9.0). In 2.10.0 or later we can do the next step. |
I have an upgrade script just about ready for testing. It saves/restores custom.css |
On the next release the css/custom.css will rename to css/custom.css.sample This change run git instructions to detach the file from own local repository. This instructions are called in untrack-css.sh file from run-start.sh and npm postinstall step Reference MagicMirrorOrg#1540
On the next release the css/custom.css will rename to css/custom.css.sample This change run git instructions to detach the file from own local repository. This instructions are called in untrack-css.sh file from run-start.sh and npm postinstall step Reference MagicMirrorOrg#1540
I've take a fast view to your scripts and there some interesting ideas. Maybe you could clean and isolated from external dependencies and send a propose to include as "update-script.sh" into |
Isolate? Clean? I intend to submit once tested more |
I mean the scripts you show there are external dependencies (in Dropbox). If you want add a script like |
ok, of course.. once tested some more I will submit a PR to include them in the release.. the current installer has a bunch of problems, which is why i have updated it. install is create new installation |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
i have submitted my upgrade and install script enhancements as pr #1789 |
@sdetweil I've merged that PR. Can I close this one? |
I am ok with closing, but I didn't open it. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I think we should keep the |
At the current moment, the file
custom.css
is versioned in git but also has an entry in the.gitignore
file. Since it was versioned first, modifications to said file make it look like there are changes from git. This PR renames that file tocustom.css.sample
to match with the config file. If a user wants custom css, they can make a copy of the file and no more changes from the git perspective!