AndreaFavero71 / cubotino

Updated scripts and files for CUBOTino autonomous: A small, 3D printed, Rubik’s cube solver robot
Creative Commons Attribution 4.0 International
47 stars 16 forks source link

gitignore *settings.txt does not work. #20

Closed paul-1 closed 5 months ago

paul-1 commented 6 months ago

I noticed in the code that you have provisions for *settings.txt to be ignored by git, and to automatically update settings files to the latest version. This does not work, because git will not ignore a file that is tracked.

The only way for this to work is to remove Cubotino_T_settings.txt and Cubotino_T_servo_settings.txt from github. I would recommend renaming these to Cubotino_T_settings_default.txt and Cubotino_T_servo_settings_default.txt. The install/setup.sh script could copy the default settings to the runtime settings files. Then a git pull would never mess up someones settings file.

Thoughts?

AndreaFavero71 commented 6 months ago

Hi Paul, it looks like I have a misconcept of the gitignore. I'll combine this fix with a change I have in the list.

AndreaFavero71 commented 6 months ago

Hi Paul, I've just released the update, that should solve this issue. The change is much larger, as I took the opportunity to have a single Class interracting with the settings, that should help on code maintenance. Please chek if this works at your side.

paul-1 commented 5 months ago

I think that 9859548dd501dde5bdbb7e18a4b810a7e3961cb8 works nicely. Of course to this version 7.0 will mess up the settings one last time. But after I merged this, I was able to pull changes I made and reset --hard, without it messing with my settings.

AndreaFavero71 commented 5 months ago

Hi Paul, when the files Cubotino_settings.txt and Cubotino_servos_settings.txt are already present locally, then the new release won't overwrite those files. By doing this, the change is backward compatible with robots built with previously released code.