diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2016-05-04 22:58:12 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-05-04 16:25:13 -0700 |
commit | 867ad08a2610526edb5723804723d371136fc643 (patch) | |
tree | 32abb4c13d2fd68c692408299aeb6ba566a359c4 /Documentation/githooks.txt | |
parent | de0824ed8fa3319cfdc0c79c06c06d7c72c6adc6 (diff) | |
download | git-867ad08a2610526edb5723804723d371136fc643.tar.gz |
hooks: allow customizing where the hook directory is
Change the hardcoded lookup for .git/hooks/* to optionally lookup in
$(git config core.hooksPath)/* instead.
This is essentially a more intrusive version of the git-init ability to
specify hooks on init time via init templates.
The difference between that facility and this feature is that this can
be set up after the fact via e.g. ~/.gitconfig or /etc/gitconfig to
apply for all your personal repositories, or all repositories on the
system.
I plan on using this on a centralized Git server where users can create
arbitrary repositories under /gitroot, but I'd like to manage all the
hooks that should be run centrally via a unified dispatch mechanism.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/githooks.txt')
-rw-r--r-- | Documentation/githooks.txt | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 30495745a0..d82e912e55 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -7,15 +7,19 @@ githooks - Hooks used by Git SYNOPSIS -------- -$GIT_DIR/hooks/* +$GIT_DIR/hooks/* (or \`git config core.hooksPath`/*) DESCRIPTION ----------- -Hooks are programs you can place in the `$GIT_DIR/hooks` directory to -trigger actions at certain points in git's execution. Hooks that don't -have the executable bit set are ignored. +Hooks are programs you can place in a hooks directory to trigger +actions at certain points in git's execution. Hooks that don't have +the executable bit set are ignored. + +By default the hooks directory is `$GIT_DIR/hooks`, but that can be +changed via the `core.hooksPath` configuration variable (see +linkgit:git-config[1]). Before Git invokes a hook, it changes its working directory to either the root of the working tree in a non-bare repository, or to the |