Skip to content

Add global git hook support

Compare
Choose a tag to compare
@BrainMaestro BrainMaestro released this 28 Oct 03:02
· 95 commits to master since this release

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.