git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Drew DeVault <sir@cmpwn.com>
Date
Feb 17, 2020, 14:44 UTC
Message-ID
<20200217144432.43920-1-sir@cmpwn.com>

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(+)
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
-- 
2.25.0
Next: Drew DeVault
Message 1 of 5 in “git-receive-pack: document push options”
  1. 1/2 git-receive-pack: document push optionsDrew DeVault, Feb 17, 2020
  2. 2/2 send-pack: downgrade push options error to warningDrew DeVault, Feb 17, 2020
  3. Jeff KingFeb 18, 2020
  4. Junio C HamanoFeb 18, 2020
  5. Jeff KingFeb 18, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.