From: Justin Tobler <jltobler@gmail.com>
To: git@vger.kernel.org
Cc: Justin Tobler <jltobler@gmail.com>
Subject: [PATCH v3] doc: clarify post-receive hook behavior
Date: Mon, 15 Jul 2024 13:37:39 -0500 [thread overview]
Message-ID: <20240715183739.7808-1-jltobler@gmail.com> (raw)
In-Reply-To: <20240714194626.29512-2-jltobler@gmail.com>
The `githooks` documentation mentions that the post-receive hook
executes once after git-receive-pack(1) updates all references and that
it also receives the same information as the pre-receive hook on
standard input. This is misleading though because the hook only
executes once if at least one of the attempted reference updates is
successful. Also, while each line provided on standard input is in the
same format as the pre-receive hook, the information received only
includes the set of references that were successfully updated.
Update the documentation to clarify these points and also provide a
reference to the post-receive hook section of the `git-receive-pack`
documentation which has additional information.
Signed-off-by: Justin Tobler <jltobler@gmail.com>
---
Greetings again,
This is the third version of my patch to clarify documentation for the
post-receive git hook. Thanks for taking a look.
Changes since v2:
- Removed added usage of link:*.html reference since links to HTML
documentation in the corresponding manual page are likely to be
broken. The provided linkgit: reference should be sufficient.
Range-diff against v2:
1: 747e925dfc ! 1: 963e3ddc83 doc: clarify post-receive hook behavior
@@ Documentation/githooks.txt: environment variables will not be set. If the client
to use push options, but doesn't transmit any, the count variable
will be set to zero, `GIT_PUSH_OPTION_COUNT=0`.
-+See the link:git-receive-pack.html#_post_receive_hook[post-receive hook]
-+section in linkgit:git-receive-pack[1] for additional details.
++See the "post-receive" section in linkgit:git-receive-pack[1] for
++additional details.
+
[[post-update]]
post-update
Documentation/githooks.txt | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
index 06e997131b..0397dec64d 100644
--- a/Documentation/githooks.txt
+++ b/Documentation/githooks.txt
@@ -415,13 +415,13 @@ post-receive
This hook is invoked by linkgit:git-receive-pack[1] when it reacts to
`git push` and updates reference(s) in its repository.
-It executes on the remote repository once after all the refs have
-been updated.
+The hook executes on the remote repository once after all the proposed
+ref updates are processed and if at least one ref is updated as the
+result.
-This hook executes once for the receive operation. It takes no
-arguments, but gets the same information as the
-<<pre-receive,'pre-receive'>>
-hook does on its standard input.
+The hook takes no arguments. It receives one line on standard input for
+each ref that is successfully updated following the same format as the
+<<pre-receive,'pre-receive'>> hook.
This hook does not affect the outcome of `git receive-pack`, as it
is called after the real work is done.
@@ -448,6 +448,9 @@ environment variables will not be set. If the client selects
to use push options, but doesn't transmit any, the count variable
will be set to zero, `GIT_PUSH_OPTION_COUNT=0`.
+See the "post-receive" section in linkgit:git-receive-pack[1] for
+additional details.
+
[[post-update]]
post-update
~~~~~~~~~~~
base-commit: a7dae3bdc8b516d36f630b12bb01e853a667e0d9
--
2.45.2
prev parent reply other threads:[~2024-07-15 18:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-12 22:47 [PATCH] doc: clarify post-receive hook behavior Justin Tobler
2024-07-12 23:11 ` Junio C Hamano
2024-07-14 18:54 ` Justin Tobler
2024-07-14 19:46 ` [PATCH v2] " Justin Tobler
2024-07-15 15:46 ` Junio C Hamano
2024-07-15 18:22 ` Justin Tobler
2024-07-15 18:44 ` Junio C Hamano
2024-07-15 18:37 ` Justin Tobler [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240715183739.7808-1-jltobler@gmail.com \
--to=jltobler@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).