From: Nicolas Pitre <nico@cam.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: Re: [PATCH] show changed tree objects with recursive git-diff-tree
Date: Mon, 23 May 2005 17:49:27 -0400 (EDT) [thread overview]
Message-ID: <Pine.LNX.4.62.0505231724270.16151@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.58.0505202025480.2206@ppc970.osdl.org>
[catching up after a weekind away -- you guys have not been standing still]
On Fri, 20 May 2005, Linus Torvalds wrote:
> On Fri, 20 May 2005, Junio C Hamano wrote:
> >
> > Although I do not have immediate objections to what it tries to
> > do, I have to think about the intent of the patch and its
> > ramifications.
>
> I really think it should be a totally separate flag to enable showing the
> sub-trees if the tree-blobification wants this.
>
> In fact, I can pretty much _guarantee_ that the patch as posted is the
> wrong thing to do: it will do horribly wrong things for things like
>
> git-whatchanged arch/i386/kernel/head.S
>
> (but I haven't tried it - try it yourself. The correct output for the
> kernel archive is just a single commit, and a single blob change in that
> commit).
OK. What about the following patch? It outputs changed tree objects
only if -p nor -v nor -s is specified, i.e. whenever what is really
wanted is output of what changed at the object level. This makes it
more coherent with the non-recursive output as well. Checked that
git-diff-helper doesn't get confused.
If a separate flag is really needed, then consistency dictates that the
non recursive output should provide output for tree objects only when
that flag is given as well, which makes the non recursive output rather
useless in most cases. And IMHO this is just too much burden for little
benefit (the extra flag not the recursive tree object output).
=====
This patch includes output of modified tree objects to recursive output,
just like non recursive output already does. When -v, -s or -p is
specified then the recursive output supresses modified tree objects
since they don't make much sense in that case.
Signed-off-by: Nicolas Pitre <nico@cam.org>
diff --git a/diff-tree.c b/diff-tree.c
--- a/diff-tree.c
+++ b/diff-tree.c
@@ -127,6 +127,8 @@ static int compare_tree_entry(void *tree
if (recursive && S_ISDIR(mode1)) {
int retval;
char *newbase = malloc_base(base, path1, pathlen1);
+ if (!silent && !verbose_header && !show_root_diff)
+ diff_change(mode1, mode2, sha1, sha2, base, path1);
retval = diff_tree_sha1(sha1, sha2, newbase);
free(newbase);
return retval;
next prev parent reply other threads:[~2005-05-23 21:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-21 1:40 [PATCH] show changed tree objects with recursive git-diff-tree Nicolas Pitre
2005-05-21 2:11 ` Junio C Hamano
2005-05-21 3:34 ` Linus Torvalds
2005-05-23 21:49 ` Nicolas Pitre [this message]
2005-05-25 6:24 ` Junio C Hamano
2005-05-25 13:38 ` Nicolas Pitre
2005-05-25 19:18 ` Junio C Hamano
2005-05-21 3:20 ` Linus Torvalds
2005-05-21 3:47 ` Junio C Hamano
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=Pine.LNX.4.62.0505231724270.16151@localhost.localdomain \
--to=nico@cam.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
--cc=torvalds@osdl.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).