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

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jan 2, 2006, 00:17 UTC
Message-ID
<Pine.LNX.4.63.0601020116020.11331@wbgn013.biozentrum.uni-wuerzburg.de>
---
	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.
 diff-tree.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
a3ff3aa99f1cc7d1e59563fbf22fed8a4f3f2d24
diff --git a/diff-tree.c b/diff-tree.c
index efa2b94..c06ccd3 100644
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -25,8 +25,9 @@ static int call_diff_flush(void)
 		return 0;
 	}
 	if (header) {
-		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;
 	}
 	diff_flush(&diff_options);
-- 
1.0.GIT
Next: Andreas Ericsson
Message 1 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.