From: Junio C Hamano Date: Thu, 4 May 2017 07:26:46 +0000 (+0900) Subject: Merge branch 'sr/hooks-cwd-doc' X-Git-Tag: v2.13.0-rc2~2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/c8ddd2aa116710e3442bc54cd750824a88a900d4?ds=inline;hp=-c Merge branch 'sr/hooks-cwd-doc' * sr/hooks-cwd-doc: githooks.txt: clarify push hooks are always executed in $GIT_DIR --- c8ddd2aa116710e3442bc54cd750824a88a900d4 diff --combined Documentation/githooks.txt index 32343ae295,f7d230f2b4..706091a569 --- a/Documentation/githooks.txt +++ b/Documentation/githooks.txt @@@ -22,8 -22,10 +22,10 @@@ changed via the `core.hooksPath` config 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 @@@ -256,9 -258,6 +258,9 @@@ environment variables will not be set. to use push options, but doesn't transmit any, the count variable will be set to zero, `GIT_PUSH_OPTION_COUNT=0`. +See the section on "Quarantine Environment" in +linkgit:git-receive-pack[1] for some caveats. + [[update]] update ~~~~~~