From: Jeff King <peff@peff.net>
To: Thomas Rast <trast@inf.ethz.ch>
Cc: git@vger.kernel.org,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Ramsay Jones" <ramsay@ramsay1.demon.co.uk>,
"Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH v2] log: use true parents for diff even when rewriting
Date: Wed, 31 Jul 2013 15:55:21 -0700 [thread overview]
Message-ID: <20130731225520.GB25882@sigill.intra.peff.net> (raw)
In-Reply-To: <e7f2ead2267ff78940aab00fe36c378a2ce5d85e.1375301293.git.trast@inf.ethz.ch>
On Wed, Jul 31, 2013 at 10:13:20PM +0200, Thomas Rast wrote:
> When using pathspec filtering in combination with diff-based log
> output, parent simplification happens before the diff is computed.
> The diff is therefore against the *simplified* parents.
>
> This works okay, arguably by accident, in the normal case:
> simplification reduces to one parent as long as the commit is TREESAME
> to it. So the simplified parent of any given commit must have the
> same tree contents on the filtered paths as its true (unfiltered)
> parent.
>
> However, --full-diff breaks this guarantee, and indeed gives pretty
> spectacular results when comparing the output of
>
> git log --graph --stat ...
> git log --graph --full-diff --stat ...
>
> (--graph internally kicks in parent simplification, much like
> --parents).
Your description (and solution) make a lot of sense to me. Another code
path that has a similar problem is the "-g" reflog walker. It rewrites
the parents based on the reflog, and the diffs it produces are mostly
useless (e.g., try "git stash list -p").
Should we be applying the same technique there?
I guess it might bother people who really want to see the diff between
two lines in the reflog (e.g., comparing the results stored by "rebase"
with the previous version). I think that is rare enough that "git diff"
would be a better tool in that case, though.
And arguably, "log -g" should not be rewriting the parents at all,
because it makes "--graph" pointless (and indeed, we disallow the
combination). So potentially the solution is to stop the rewriting
entirely, not mask it for the diffs. But doing so might be a good
interim solution until somebody feels like rewriting the reflog walker.
-Peff
prev parent reply other threads:[~2013-07-31 22:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 9:08 git log anomalities Uwe Kleine-König
2013-07-22 10:40 ` Thomas Rast
2013-07-22 21:22 ` [PATCH] log: use true parents for diff even when rewriting Thomas Rast
2013-07-22 21:48 ` Junio C Hamano
2013-07-23 7:27 ` Thomas Rast
2013-07-23 7:49 ` Uwe Kleine-König
2013-07-23 19:55 ` Junio C Hamano
2013-07-31 20:13 ` [PATCH v2] " Thomas Rast
2013-07-31 22:55 ` Jeff King [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130731225520.GB25882@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=ramsay@ramsay1.demon.co.uk \
--cc=trast@inf.ethz.ch \
--cc=u.kleine-koenig@pengutronix.de \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).