Confbase / cfg

A tool to manage configuration files and use them in production.
https://confbase.com/cfg
Apache License 2.0
7 stars 6 forks source link

More descriptive error message for checking out a snap with uncommitted files in git #67

Open Drake-Eidukas opened 5 years ago

Drake-Eidukas commented 5 years ago

So, for fun, I made a file and marked it, then deleted it. I also manually edited the .cfg.json to see what that was all about.

Currently, the error message is just:

drake@element:~/workspace/test_base$ cfg snap checkout master
error: there are uncommitted files
'git status -s' output:
 M .cfg.json
D  .cfg_schemas/lol
 D lol/hh/lol.yaml

I think that the error message seems somewhat... barebones. Could be nice to update this to be more consistent with cfg / suggest how to fix the issues with modified / deleted, but it just feels weird to show a git message here.

Drake-Eidukas commented 5 years ago

One suggestion I have is to provide a cfg reset command, which resets files tracked by cfg to the state they were in at the last successful git commit hash generated by cfg, and provide a help text in this case that shows how to run that command to fix the state of the base.