githooks.txt: clarify push hooks are always executed in $GIT_DIR
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>
Simon Ruderich committed
Apr 29, 2017 at 14:28 UTC
501d3cd7b8cf469e6a5aa86809fc25316695d344
1 file changed
+4
-2
Documentation/githooks.txt
+4
-2
@@ -22,8 +22,10 @@ changed via the `core.hooksPath` configuration variable (see
22
linkgit:git-config[1]).
23
24
Before Git invokes a hook, it changes its working directory to either
25
-the root of the working tree in a non-bare repository, or to the
26
-$GIT_DIR in a bare repository.
25
+$GIT_DIR in a bare repository or the root of the working tree in a non-bare
26
+repository. An exception are hooks triggered during a push ('pre-receive',
27
+'update', 'post-receive', 'post-update', 'push-to-checkout') which are always
28
+executed in $GIT_DIR.
29
30
Hooks can get their arguments via the environment, command-line
31
arguments, and stdin. See the documentation for each hook below for