Skip to content

Commit 7db2cbf

Browse files
committed
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>
1 parent 9752ad0 commit 7db2cbf

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

Documentation/githooks.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ to the user by writing to standard error.
222222
pre-receive
223223
~~~~~~~~~~~
224224

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.
227227
Just before starting to update refs on the remote repository, the
228228
pre-receive hook is invoked. Its exit status determines the success
229229
or failure of the update.
@@ -260,8 +260,8 @@ will be set to zero, `GIT_PUSH_OPTION_COUNT=0`.
260260
update
261261
~~~~~~
262262

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.
265265
Just before updating the ref on the remote repository, the update hook
266266
is invoked. Its exit status determines the success or failure of
267267
the ref update.
@@ -305,8 +305,8 @@ unannotated tags to be pushed.
305305
post-receive
306306
~~~~~~~~~~~~
307307

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.
310310
It executes on the remote repository once after all the refs have
311311
been updated.
312312

@@ -344,8 +344,8 @@ will be set to zero, `GIT_PUSH_OPTION_COUNT=0`.
344344
post-update
345345
~~~~~~~~~~~
346346

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.
349349
It executes on the remote repository once after all the refs have
350350
been updated.
351351

@@ -375,8 +375,8 @@ for the user.
375375
push-to-checkout
376376
~~~~~~~~~~~~~~~~
377377

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
380380
the push tries to update the branch that is currently checked out
381381
and the `receive.denyCurrentBranch` configuration variable is set to
382382
`updateInstead`. Such a push by default is refused if the working

0 commit comments

Comments
 (0)