diff mbox series

[1/2] git-receive-pack: document push options

Message ID 20200217144432.43920-1-sir@cmpwn.com (mailing list archive)
State New, archived
Headers show
Series [1/2] git-receive-pack: document push options | expand

Commit Message

Drew DeVault Feb. 17, 2020, 2:44 p.m. UTC
This adds the missing documentation on how git push options are
presented to the pre-receive hook.

Signed-off-by: Drew DeVault <sir@cmpwn.com>
---
 Documentation/git-receive-pack.txt | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Jeff King Feb. 18, 2020, 5:30 a.m. UTC | #1
On Mon, Feb 17, 2020 at 09:44:31AM -0500, Drew DeVault wrote:

>  Documentation/git-receive-pack.txt | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/Documentation/git-receive-pack.txt b/Documentation/git-receive-pack.txt
> index 25702ed730..69b3e77776 100644
> --- a/Documentation/git-receive-pack.txt
> +++ b/Documentation/git-receive-pack.txt
> @@ -109,6 +109,12 @@ the following environment variables:
>  This hook is called before any refname is updated and before any
>  fast-forward checks are performed.
>  
> +If the user has specified any push options (see linkgit:git-push[1]),
> +`GIT_PUSH_OPTION_COUNT` is set to the number of options, and
> +`GIT_PUSH_OPTION_N` is set where N is an integer from 0 thru
> +`GIT_PUSH_OPTION_COUNT` - 1. In order for to receive push options,
> +`receive.advertisePushOptions` must be enabled on the server.

Hmm. This is covered already in the pre-receive sections of githooks(7).
I wonder if it would be worth consolidating those and having one refer
to the other.

I'd be OK just duplicating the content in the meantime, but note that
the githooks version covers some more subtleties (like setting the count
to 0 when push options are negotiated but none are sent).

If we do go with the text above, there's a typo: s/for to/to/.

-Peff
diff mbox series

Patch

diff --git a/Documentation/git-receive-pack.txt b/Documentation/git-receive-pack.txt
index 25702ed730..69b3e77776 100644
--- a/Documentation/git-receive-pack.txt
+++ b/Documentation/git-receive-pack.txt
@@ -109,6 +109,12 @@  the following environment variables:
 This hook is called before any refname is updated and before any
 fast-forward checks are performed.
 
+If the user has specified any push options (see linkgit:git-push[1]),
+`GIT_PUSH_OPTION_COUNT` is set to the number of options, and
+`GIT_PUSH_OPTION_N` is set where N is an integer from 0 thru
+`GIT_PUSH_OPTION_COUNT` - 1. In order for to receive push options,
+`receive.advertisePushOptions` must be enabled on the server.
+
 If the pre-receive hook exits with a non-zero exit status no updates
 will be performed, and the update, post-receive and post-update
 hooks will not be invoked either.  This can be useful to quickly