doc: clarify how exit status of post-checkout hook is used
Because the hook runs after the main checkout operation finishes, it cannot affect what branch will be the current branch, what paths are updated in the working tree, etc., which was described as "cannot affect the outcome of 'checkout'". However, the exit status of the hook is used as the exit status of the 'checkout' command and is observable by anybody who spawned the 'checkout', which was missing from the documentation. Fix this. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Aug 27, 2020 at 14:45 UTC
3100fd55888ce742056cc998343c5fc9f89b2c55
1 file changed
+3
-1
Documentation/githooks.txt
+3
-1
@@ -193,7 +193,9 @@ worktree. The hook is given three parameters: the ref of the previous HEAD,
193
the ref of the new HEAD (which may or may not have changed), and a flag
194
indicating whether the checkout was a branch checkout (changing branches,
195
flag=1) or a file checkout (retrieving a file from the index, flag=0).
196
-This hook cannot affect the outcome of `git switch` or `git checkout`.
196
+This hook cannot affect the outcome of `git switch` or `git checkout`,
197
+other than that the hook's exit status becomes the exit status of
198
+these two commands.
199
200
It is also run after linkgit:git-clone[1], unless the `--no-checkout` (`-n`) option is
201
used. The first parameter given to the hook is the null-ref, the second the