From 501d3cd7b8cf469e6a5aa86809fc25316695d344 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 29 Apr 2017 14:28:29 +0200 Subject: githooks.txt: clarify push hooks are always executed in $GIT_DIR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt index 9565dc3..f7d230f 100644 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@ -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 -- cgit v0.10.2-6-g49f6