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

Re: [PATCH] diff-tree: stop on broken output pipe

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 7, 2006, 00:41 UTC
Message-ID
<Pine.LNX.4.63.0601070134010.30029@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<7vhd8ht24d.fsf@assigned-by-dhcp.cox.net>
Hi,
On Fri, 6 Jan 2006, Junio C Hamano wrote:
Show 16 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > 	Without this, on my iBook git-whatchanged keeps running when I 
> > 	quit "less". I have to interrupt the process a second time. No
> > 	idea why it works on Linux.
> >
> > -		if (!no_commit_id)
> > -			printf("%s%c", header, diff_options.line_termination);
> > +		if (!no_commit_id && printf("%s%c", header,
> > +				diff_options.line_termination) < 0)
> > +			die("broken output pipe");
> >  		header = NULL;
> 
> There are tons of output other than this printf() and catching
> an output error only on this one and assuming that is a broken
> pipe somehow feels doubly wrong to me.
Welcome back! Hope you had a good time, and the fish tasted fine.
There really are tons of printf(), but
- I did not want to be invasive,
- if one printf() fails, the next will, too (probably), and
- the problem occurs only on macosx here.

Maybe it is not correct to assume that the output pipe is broken, but it is an error to keep going when printf() fails. So I picked one printf() which is called regularly.

Andreas said that a SIGPIPE should be thrown, and bash should kill the script. I have not found out why my bash doesn't. Until I do, I will have this patch in my local git (and a similar patch in git-rev-list). It just is plain annoying when git-whatchanged (the git script I use most often) hangs there, burning cycles.

Ciao, Dscho

Previous: Junio C Hamano
Message 5 of 5 in “diff-tree: stop on broken output pipe”
  1. diff-tree: stop on broken output pipeJohannes Schindelin, Jan 2, 2006
  2. Andreas EricssonJan 2, 2006
  3. Johannes SchindelinJan 2, 2006
  4. Junio C HamanoJan 6, 2006
  5. Johannes SchindelinJan 7, 2006

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.