hooks doc: clarify when receive-pack invokes its hooks

The text meant to say that receive-pack runs these hooks, and only because receive-pack is not a command the end users use every day (ever), as an explanation also meantioned that it is run in response to 'git push', which is an end-user facing command readers hopefully know about. This unfortunately gave an incorrect impression that 'git push' always result in the hook to run. If the refs push wanted to update all already had the desired value, these hooks are not run. Explicitly mention "... and updates reference(s)" as a precondition to avoid this confusion. Helped-by: Christoph Michelbach <michelbach94@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Nov 24, 2017 at 11:10 UTC 7db2cbf4f13bc2e433828fd6dba1748551a14aff
1 file changed +10 -10
Documentation/githooks.txt
+10 -10
@@ -222,8 +222,8 @@ to the user by writing to standard error.
222 pre-receive
223 ~~~~~~~~~~~
224
225 -This hook is invoked by 'git-receive-pack' on the remote repository,
226 -which happens when a 'git push' is done on a local repository.
225 +This hook is invoked by 'git-receive-pack' when it reacts to
226 +'git push' and updates reference(s) in its repository.
227 Just before starting to update refs on the remote repository, the
228 pre-receive hook is invoked. Its exit status determines the success
229 or failure of the update.
@@ -260,8 +260,8 @@ will be set to zero, `GIT_PUSH_OPTION_COUNT=0`.
260 update
261 ~~~~~~
262
263 -This hook is invoked by 'git-receive-pack' on the remote repository,
264 -which happens when a 'git push' is done on a local repository.
263 +This hook is invoked by 'git-receive-pack' when it reacts to
264 +'git push' and updates reference(s) in its repository.
265 Just before updating the ref on the remote repository, the update hook
266 is invoked. Its exit status determines the success or failure of
267 the ref update.
@@ -305,8 +305,8 @@ unannotated tags to be pushed.
305 post-receive
306 ~~~~~~~~~~~~
307
308 -This hook is invoked by 'git-receive-pack' on the remote repository,
309 -which happens when a 'git push' is done on a local repository.
308 +This hook is invoked by 'git-receive-pack' when it reacts to
309 +'git push' and updates reference(s) in its repository.
310 It executes on the remote repository once after all the refs have
311 been updated.
312
@@ -344,8 +344,8 @@ will be set to zero, `GIT_PUSH_OPTION_COUNT=0`.
344 post-update
345 ~~~~~~~~~~~
346
347 -This hook is invoked by 'git-receive-pack' on the remote repository,
348 -which happens when a 'git push' is done on a local repository.
347 +This hook is invoked by 'git-receive-pack' when it reacts to
348 +'git push' and updates reference(s) in its repository.
349 It executes on the remote repository once after all the refs have
350 been updated.
351
@@ -375,8 +375,8 @@ for the user.
375 push-to-checkout
376 ~~~~~~~~~~~~~~~~
377
378 -This hook is invoked by 'git-receive-pack' on the remote repository,
379 -which happens when a 'git push' is done on a local repository, when
378 +This hook is invoked by 'git-receive-pack' when it reacts to
379 +'git push' and updates reference(s) in its repository, and when
380 the push tries to update the branch that is currently checked out
381 and the `receive.denyCurrentBranch` configuration variable is set to
382 `updateInstead`. Such a push by default is refused if the working