From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Michał Łowicki" <mlowicki@gmail.com>, git@vger.kernel.org
Subject: Re: gsoc - Better git log --follow support
Date: Wed, 23 Mar 2011 13:06:55 -0400 [thread overview]
Message-ID: <20110323170655.GA4392@sigill.intra.peff.net> (raw)
In-Reply-To: <7v8vw5g4f0.fsf@alter.siamese.dyndns.org>
On Wed, Mar 23, 2011 at 09:58:11AM -0700, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > # Now try it with --follow. Not so pretty.
> > git log --oneline --graph --follow builtin/add.c
>
> Is that an artifact of history simplification?
I think it's a combination of factors. The lack of history
simplification is why the graph is all choppy. The insanely wide
results, though, are probably due to the problem you mention below.
> I've always thought that it was because --follow hack used a single global
> pathspec that flipped at a rename boundary,regardless of which part of the
> history (i.e. the branch that was before the rename or after the rename)
> it is following. So if you have two branches merged together:
>
> o---o---o---o---o---x---x---x
> / /
> ...o---o---o---x---x---x
>
> where commits marked with 'x' has it under the new path while commits
> marked with 'o' has it under the old path, and start to dig the history
> from the rightmost commit, the hack notices the rename at the transition
> between the "o---x" on the upper branch and from then on keep digging the
> history using the old path as the pathspec. The commit history traversal
> goes reverse-chronologically, so when inspecting the next commit, which is
> the rightmost commit on the lower branch, the hack fails because it uses a
> wrong pathspec (at that point it should still be using the new path as the
> pathspec, but it already has switched to the old path).
When I prototyped the multi-file --follow last summer, I added newly
found source paths to the pathspec list instead of replacing them.
Strictly speaking, this can add unwanted commits when the names are
re-used for unrelated files (either the source name is used on a
parallel side branch, or the destination name is used in an earlier
file). But in practice it generates pretty good results, because those
corner cases don't tend to happen much.
Obviously a solution that always provides an exact right answer is
preferable to "pretty good results", but we'd have to keep in mind the
performance difference.
-Peff
next prev parent reply other threads:[~2011-03-23 17:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-19 19:24 gsoc - Better git log --follow support Michał Łowicki
2011-03-19 21:57 ` GSoC - Better "git log --follow" support Jakub Narebski
2011-03-21 12:24 ` gsoc - Better git log --follow support Jeff King
2011-03-22 23:23 ` Michał Łowicki
2011-03-23 16:20 ` Jeff King
2011-03-23 16:58 ` Junio C Hamano
2011-03-23 17:06 ` Jeff King [this message]
2011-03-23 18:12 ` Junio C Hamano
2011-03-23 18:22 ` Jeff King
2011-04-13 21:04 ` Michał Łowicki
2011-04-15 4:06 ` Jonathan Nieder
2011-04-15 19:41 ` Michał Łowicki
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=20110323170655.GA4392@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mlowicki@gmail.com \
/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).