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

[PATCH] git-update-index: report(...) now flushes stdout after printing the report line

From
Sebastian Thiel <byronimo@gmail.com>
Date
Nov 19, 2009, 21:17 UTC
Message-ID
<loom.20091119T221732-624@post.gmane.org>
This makes it equivalent to the behavior of git-hash-object and allows tools to
write one path
to stdin, flush and assure the work is done once it reads the corresponding
report line.
Previously attempting to do that would result in the program blocking as
git-update-index
did not flush its report line (yet). External programs use the git-hash-object
like behavior
to precisely control when which work is done while providing just-in-time
feedback to the end-user.
---
 builtin-update-index.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/builtin-update-index.c b/builtin-update-index.c
index 92beaaf..08bf933 100644
--- a/builtin-update-index.c
+++ b/builtin-update-index.c
@@ -37,6 +37,7 @@ static void report(const char *fmt, ...)
 	va_start(vp, fmt);
 	vprintf(fmt, vp);
 	putchar('\n');
+	maybe_flush_or_die(stdout, "line to stdout");
 	va_end(vp);
 }
 
-- 
1.6.5.3.172.g9e796
Next: Nanako Shiraishi
Message 1 of 9 in “git-update-index: report(...) now flushes stdout after printing the report line”
  1. git-update-index: report(...) now flushes stdout after printing the report lineSebastian Thiel, Nov 19, 2009
  2. Nanako ShiraishiDec 30, 2009
  3. Junio C HamanoDec 30, 2009
  4. Sebastian ThielDec 30, 2009
  5. Sebastian ThielJan 3, 2010
  6. Tay Ray ChuanJan 3, 2010
  7. Sebastian ThielJan 4, 2010
  8. Junio C HamanoJan 6, 2010
  9. Tay Ray ChuanJan 6, 2010

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.