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

Re: [PATCH] Clarify pre-push hook documentation

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Mar 24, 2014, 01:40 UTC
Message-ID
<CAPig+cSCGRkWioaEnCjKS4c981dnCVbeej-9bCTztfc-wnbhbA@mail.gmail.com>
In-Reply-To
<1395601267-78377-1-git-send-email-dcow90@gmail.com>
On Sun, Mar 23, 2014 at 3:01 PM, David Cowden <dcow90@gmail.com> wrote:
> The documentation as-is does not mention that the pre-push hook is
> executed even when there is nothing to push.  This can lead a new
> reader to beilieve there will always be lines fed to the script's
> standerd input and cause minor confusion as to what is happening
s/standerd/standard/
Show 34 quoted lines
> when there are no lines provided to the pre-push script.
>
> Signed-off-by: David Cowden <dcow90@gmail.com>
> ---
>
> Notes:
>     c.f. http://stackoverflow.com/questions/22585091/git-hooks-pre-push-script\
>     -does-not-receive-input-via-stdin
>
>  Documentation/githooks.txt | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt
> index d954bf6..a28f6f7 100644
> --- a/Documentation/githooks.txt
> +++ b/Documentation/githooks.txt
> @@ -203,6 +203,10 @@ SHA-1>` will be 40 `0`.  If the local commit was specified by something other
>  than a name which could be expanded (such as `HEAD~`, or a SHA-1) it will be
>  supplied as it was originally given.
>
> +The hook is executed regardless of whether there are changes to push or not.
> +In the event that there are no changes, no data will be provided on the
> +script's standard input.
> +
>  If this hook exits with a non-zero status, 'git push' will abort without
>  pushing anything.  Information about why the push is rejected may be sent
>  to the user by writing to standard error.
> --
> 1.9.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous: David CowdenNext: David Cowden
Message 5 of 10 in “Clarify pre-push hook documentation”
  1. Clarify pre-push hook documentationDavid Cowden, Mar 23, 2014
  2. Clarify pre-push hook documentationDavid Cowden, Mar 23, 2014
  3. Junio C HamanoMar 23, 2014
  4. Clarify pre-push hook documentationDavid Cowden, Mar 23, 2014
  5. Eric SunshineMar 24, 2014
  6. Clarify pre-push hook documentationDavid Cowden, Mar 24, 2014
  7. Clarify pre-push hook documentationDavid Cowden, Mar 24, 2014
  8. Junio C HamanoMar 25, 2014
  9. Philip OakleyMar 26, 2014
  10. David CowdenApr 8, 2014

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.