tommarshall / git-good-commit

Git hook to help you write good commit messages, with no external dependencies.
MIT License
195 stars 33 forks source link

Added `make install` and `make repair` targets. #16

Closed ssbarnea closed 4 years ago

ssbarnea commented 7 years ago

Make install will install the hook globally and make repair will install the hook on all existing git repos in the user home directory (recursive find).

tommarshall commented 7 years ago

Hi @ssbarnea,

Thanks for the PR.

At the moment the recommended installation method is to download the script directly. This felt like the simplest approach given that you only need the single script, however I have been considering alternatives as git init will not overwrite an existing hook, which makes updating trickier than I'd like it to be.

If I'm understanding this correctly it appears that make repair is replacing the .git/hooks/commit-msg files with a symlink to the file within the repository, rather than within ~/.git-template/, i.e. a user would need to keep the repository on disk after running make repair. Is that correct?

Tom

ssbarnea commented 7 years ago

Yes this is correct. Now is up to you to decide if you like this or not or if you would want different behaviours or option names.

I implemented like this because it was convenient to my use case. The make tool is for developers only, it doesn't get shipped to normal users. I do like the symlink approach for obvious reasons.

Other options: hardlinks? BTW, I do not rely on templates because I could have other hook there than this ones.

I have to confess that make repair does quite an aggressive job at the moment :)