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

[PATCH] cat-file --batch: flush stdout also when objects are missing

From
LWLea Wiemann <lewiemann@gmail.com>
Date
Jun 3, 2008, 18:34 UTC
Message-ID
<1212518057-9137-1-git-send-email-LeWiemann@gmail.com>

cat-file --batch/--batch-check only flushes stdout when the object exists, but not when it doesn't ("<object> missing"). This makes bidirectional pipes hang.

Signed-off-by: Lea Wiemann <LeWiemann@gmail.com>
---
 builtin-cat-file.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/builtin-cat-file.c b/builtin-cat-file.c
index 200345e..f8b3160 100644
--- a/builtin-cat-file.c
+++ b/builtin-cat-file.c
@@ -159,6 +159,7 @@ static int batch_one_object(const char *obj_name, int print_contents)
 
 	if (get_sha1(obj_name, sha1)) {
 		printf("%s missing\n", obj_name);
+		fflush(stdout);
 		return 0;
 	}
 
-- 
1.5.6.rc0.92.g27fd.dirty
Next: Junio C Hamano
Message 1 of 2 in “cat-file --batch: flush stdout also when objects are missing”
  1. cat-file --batch: flush stdout also when objects are missingLea Wiemann, Jun 3, 2008
  2. Junio C HamanoJun 3, 2008

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.