githooks.txt: clarify push hooks are always executed in $GIT_DIR
authorSimon Ruderich <simon@ruderich.org>
Sat, 29 Apr 2017 12:28:29 +0000 (14:28 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 May 2017 01:56:15 +0000 (10:56 +0900)
Listing the specific hooks might feel verbose but without it the
reader is left to wonder which hooks are triggered during the
push. Something which is not immediately obvious when only trying
to find out where the hook is executed.

Signed-off-by: Simon Ruderich <simon@ruderich.org>
Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/githooks.txt
index 9565dc3fda47d7c8a7290132c347b5a6f0d2422e..f7d230f2b408c652113c3728339d84de6f229981 100644 (file)
@@ -22,8 +22,10 @@ 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
-$GIT_DIR in a bare repository.
+$GIT_DIR in a bare repository or the root of the working tree in a non-bare
+repository. An exception are hooks triggered during a push ('pre-receive',
+'update', 'post-receive', 'post-update', 'push-to-checkout') which are always
+executed in $GIT_DIR.
 
 Hooks can get their arguments via the environment, command-line
 arguments, and stdin. See the documentation for each hook below for