From: Jeff King <peff@peff.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Albert Krawczyk <albert@burgmann.anu.edu.au>, git@vger.kernel.org
Subject: Re: Git log follow question
Date: Wed, 26 May 2010 01:58:23 -0400 [thread overview]
Message-ID: <20100526055823.GA30409@coredump.intra.peff.net> (raw)
In-Reply-To: <alpine.LFD.2.00.1005251141580.3689@i5.linux-foundation.org>
On Tue, May 25, 2010 at 11:49:25AM -0700, Linus Torvalds wrote:
> On Tue, 25 May 2010, Jeff King wrote:
> >
> > Thanks for the input. I took a look at it myself and it is a bit more
> > complex than just turning on pruning. I have a prototype --follow that
> > handles arbitrary pathspecs instead of single files; instead of
> > replacing the single-file pathspec, it just widens the pathspec as it
> > traverses history.
>
> Doing it "right" is actually a _lot_ more complex than that.
Did you mean doing history rewriting right is more complex than that, or
did you mean that handling multiple follow pathspecs is more complex
than pathspec-widening (where "handling multiple pathspecs" means making
"--follow subdir" work about as well as "--follow file", but not
actually doing real history rewriting)?
If the former, I agree.
If the latter, I am not sure it is any worse than the single-file follow
case.
For example, consider this history:
echo content >file && git add . && git commit -m base
git mv file new && git commit -m moved
sleep 1 ;# to ensure timestamp difference
git checkout -b other HEAD^
echo changes >>file && git commit -a -m changes
git merge master
We'll traverse in this order:
merge
changes (to file)
moved (from file to new)
base (create file)
If I do "git log --follow new" with the current master, I will see only
"moved" and "base". I don't see "changes" because it operates on "file",
not "new". But if we reverse the order in which the two branches'
commits were made, then we will parse "moved" first, and we _will_ see
"changes", because we've updated our pathspec. So it matters when we
traverse the rename.
For "base" and everything prior to it, in general we will already have
traversed the rename because we try to do things in date order. But in
the face of clock skew, it is possible to follow the ancestry down
before hitting a rename on another branch.
So my point is that even with the current --follow, there are already
corner cases where traversal order matters. Which is maybe the point you
were trying to make, too, but I was unclear from your example if you
meant that the problem was _worse_ with simple expansion of pathspecs
(i.e., not actually turning on revs->prune) than the current --follow.
-Peff
next prev parent reply other threads:[~2010-05-26 5:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-14 0:57 Git log follow question Albert Krawczyk
2010-05-14 4:16 ` Bo Yang
2010-05-14 4:37 ` Jeff King
2010-05-14 14:50 ` Linus Torvalds
2010-05-14 15:19 ` Martin Langhoff
2010-05-14 15:29 ` Linus Torvalds
[not found] ` <22729_1273851106_4BED6CE2_22729_6897_1_alpine.LFD.2.00.1005140827250.3711@i5.linux-foundation.org>
2010-05-14 22:39 ` Albert Krawczyk
2010-05-25 9:31 ` Jeff King
2010-05-25 18:49 ` Linus Torvalds
2010-05-26 5:58 ` Jeff King [this message]
2010-05-26 14:40 ` Linus Torvalds
[not found] ` <21464_1273811837_4BECD37D_21464_745_1_20100514043704.GC6075@coredump.intra.peff.net>
2010-05-14 4:43 ` Albert Krawczyk
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=20100526055823.GA30409@coredump.intra.peff.net \
--to=peff@peff.net \
--cc=albert@burgmann.anu.edu.au \
--cc=git@vger.kernel.org \
--cc=torvalds@linux-foundation.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).