All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Paul Mackerras <paulus@samba.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Make git-diff-tree indicate when it flushes
Date: Mon, 29 May 2006 15:18:01 -0700	[thread overview]
Message-ID: <7vr72c79wm.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: <7vzmh07a9k.fsf@assigned-by-dhcp.cox.net> (Junio C. Hamano's message of "Mon, 29 May 2006 15:10:15 -0700")

Junio C Hamano <junkio@cox.net> writes:

> 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;
 }

  reply	other threads:[~2006-05-29 22:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-29 12:24 [PATCH] Make git-diff-tree indicate when it flushes Paul Mackerras
2006-05-29 18:38 ` Junio C Hamano
2006-05-29 22:02   ` Paul Mackerras
2006-05-29 22:10     ` Junio C Hamano
2006-05-29 22:18       ` Junio C Hamano [this message]
2006-05-29 22:32         ` Paul Mackerras
2006-05-29 22:31       ` Paul Mackerras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vr72c79wm.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.