add new action: init which combines --install and --store#46
add new action: init which combines --install and --store#46samirnoman wants to merge 2 commits intodanny0838:mainfrom
Conversation
|
After thinking more about it, I think it might be helpful to also add .git_store_meta and commit it the repo using the action --init (need to check that the work-tree is clean).
I recommend checking if the work tree is clean before executing it, similar to the checks in apply. I think this is what most users should expect when using --init . |
|
As |
init action will run the equivalent of these commands in the following order: * perl git-store-meta.pl --store * git add .git_store_meta * git commit -m 'initialize with git-store-meta.pl @Verion#' * perl git-store-meta.pl --install NOTE: installing hooks will be the last step in order to avoid firing pre-commit trigger
97a4450 to
c91577f
Compare
|
fixed eol |
when we add git-store-meta for the first time to a git repo, we have to issue two seperate commands:
If we only install the hooks, the .git_store_meta is not created automatically. Without the file .git_store_meta, the hooks will not do anything.
This might confuse new users, because they may assume that installing the hooks is enough.
There are a few solutions to this:
I have made a modification to implement the third alternative (add action --init) because I think it's meaning is more intuitive to git users.
TODO: I think it might be a good idea to check if .git_store_meta already exist before overwriting it with --init action; unless --force is in effect (or use another option for that)