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

Re: [PATCH] Make git-diff-tree indicate when it flushes

From
Junio C Hamano <junkio@cox.net>
Date
May 29, 2006, 22:18 UTC
Message-ID
<7vr72c79wm.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<7vzmh07a9k.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
Show 7 quoted lines
> Paul Mackerras <paulus@samba.org> writes:
>
>> With --always, how do I tell that 65aadb affects apply.c and cc189c
>> doesn't?
>
> I am not quite sure exactly what you are trying to achieve, but
> one trivial way is not giving -s perhaps?

Having said that, I suspect this might be a better way. Whatever you throw at it from stdin that are not a validly looking object name, you will get them back, so you can use your favorite markers.

diff --git a/builtin-diff-tree.c b/builtin-diff-tree.c
index cc53b81..7208c48 100644
--- a/builtin-diff-tree.c
+++ b/builtin-diff-tree.c
@@ -138,11 +138,15 @@ int cmd_diff_tree(int argc, const char *
 	if (opt->diffopt.detect_rename)
 		opt->diffopt.setup |= (DIFF_SETUP_USE_SIZE_CACHE |
 				       DIFF_SETUP_USE_CACHE);
-	while (fgets(line, sizeof(line), stdin))
-		if (line[0] == '\n')
+	while (fgets(line, sizeof(line), stdin)) {
+		unsigned char sha1[20];
+
+		if (get_sha1_hex(line, sha1)) {
+			fputs(line);
 			fflush(stdout);
+		}
 		else
 			diff_tree_stdin(line);
-
+	}
 	return 0;
 }
Previous: Junio C HamanoNext: Paul Mackerras
Message 5 of 7 in “Make git-diff-tree indicate when it flushes”
  1. Make git-diff-tree indicate when it flushesPaul Mackerras, May 29, 2006
  2. Junio C HamanoMay 29, 2006
  3. Paul MackerrasMay 29, 2006
  4. Junio C HamanoMay 29, 2006
  5. Junio C HamanoMay 29, 2006
  6. Paul MackerrasMay 29, 2006
  7. Paul MackerrasMay 29, 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.