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

Re: [PATCH] allow hooks to ignore their standard input stream

From
Jeff King <peff@peff.net>
Date
Nov 13, 2015, 23:23 UTC
Message-ID
<20151113232320.GB16173@sigill.intra.peff.net>
In-Reply-To
<20151113093303.GA4111@musxeris015.imu.intel.com>
On Fri, Nov 13, 2015 at 10:33:03AM +0100, Clemens Buchacher wrote:
Show 7 quoted lines
> Since ec7dbd145 (receive-pack: allow hooks to ignore its standard input stream)
> the pre-receive and post-receive hooks ignore SIGPIPE. Do the same for the
> remaining hooks pre-push and post-rewrite, which read from standard input. The
> same arguments for ignoring SIGPIPE apply.
> 
> Performance improvements which allow us to enable the test by
> default by Jeff King.
I actually did add a new test. The existing one was basically this:
> +test_expect_success 'filling pipe buffer does not cause failure' '
> +	git push parent1 "refs/heads/b/*:refs/heads/b/*" &&
> +	test_cmp expected actual
> +'

It actually _does_ read all of the input, but I guess is making sure we call write() in a loop. I don't know if this is even worth keeping.

Can you think of a good reason that it is checking something interesting?

> +test_expect_success 'sigpipe does not cause pre-push hook failure' '
> +	echo "exit 0" | write_script "$HOOK" &&
> +	git push parent1 "refs/heads/b/*:refs/heads/c/*"
> +'
This is the new one which checks your code.
-Peff
Previous: Clemens BuchacherNext: Clemens Buchacher
Message 5 of 8 in “allow hooks to ignore their standard input stream”
  1. allow hooks to ignore their standard input streamClemens Buchacher, Nov 11, 2015
  2. Clemens BuchacherNov 11, 2015
  3. Jeff KingNov 13, 2015
  4. Clemens BuchacherNov 13, 2015
  5. Jeff KingNov 13, 2015
  6. Clemens BuchacherNov 16, 2015
  7. Jeff KingNov 16, 2015
  8. Jeff KingNov 13, 2015

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.