Add global git hook support
All commands (besides the hook test ones) gained the ability to manage hooks globally with the --global
option.
Like:
# Adds hooks in global directory (falls back to git config core.hooksPath and $COMPOSER_HOME)
cghooks add --global
# You can also directly specify the directory
cghooks add --global --git-dir /home/brainmaestro/.config/git_hooks
The update
, list-hooks
and remove
commands work similarly.
This change was non-trivial because the application assumed it was always being run in the current directory. Took the opportunity for some cleanup as well.