From: Junio C Hamano Date: Mon, 29 May 2006 22:18:01 GMT Subject: Re: [PATCH] Make git-diff-tree indicate when it flushes Message-ID: <7vr72c79wm.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <7vzmh07a9k.fsf@assigned-by-dhcp.cox.net> Junio C Hamano writes: > Paul Mackerras 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; }