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

Re: hooks that do not consume stdin sometimes crash git with SIGPIPE

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 6, 2011, 01:39 UTC
Message-ID
<7vmxb6iim0.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20111205192930.GA32463@gnu.kitenet.net>
Joey Hess <joey@kitenet.net> writes:
Show 8 quoted lines
> We had a weird problem where, after moving to a new, faster server,
> "git push" would sometimes fail like this:
>
> Unpacking objects: 100% (3/3), done.
> fatal: The remote end hung up unexpectedly
> fatal: The remote end hung up unexpectedly
>
> Turns out that git-receive-pack was dying due to an uncaught SIGPIPE.

Why do you have a hook that is expected to read from receive-pack that does _not_ read anything from it in the first place? If you do not care about the update status given to pre-receive, shouldn't you be using the update hook and ignoring the command line parameters instead?

I am not saying this is a user configuration error and there is nothing to fix---Git shouldn't get killed merely because of configuration error.

I am wondering if we would want to have a uniform way to tell run_*_hook() functions that the hook writer explicitly declines to get any input. E.g. "hooks/pre-receive-noinput" is called instead of "hooks/pre-receive" and we do not send any input to it, or something like that.

Previous: Jeff KingNext: Joey Hess
Message 6 of 7 in “do not require filters to consume stdin”
  1. do not require filters to consume stdinJoey Hess, Aug 29, 2011
  2. Junio C HamanoAug 29, 2011
  3. Joey HessAug 30, 2011
  4. hooks that do not consume stdin sometimes crash git with SIGPIPEJoey Hess, Dec 5, 2011
  5. Jeff KingDec 5, 2011
  6. Junio C HamanoDec 6, 2011
  7. Joey HessDec 6, 2011

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.