git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Git log follow question

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
May 25, 2010, 18:49 UTC
Message-ID
<alpine.LFD.2.00.1005251141580.3689@i5.linux-foundation.org>
In-Reply-To
<20100525093140.GA32460@coredump.intra.peff.net>
On Tue, 25 May 2010, Jeff King wrote:
Show 6 quoted lines
> 
> 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.

Think especially about the case of the file having been renamed in one branch, and in another branch it was created from scratch, and then a merge that sorts it all out (think two people aiming for the same thing, just doing it differently - but with similar approaches).

Now, imagine reaching the common commit by walking _one_ of the chains before having walked the other one fully. So now you're looking at a commit using one set of pathnames, and then later on you'll hit the _same_ commit (through the other branch), but with another set of pathnames. But by then you've already handled that commit.

The above isn't an issue with the regular pathname pruning, because the pruning rules never change - so the order of handling commits never matter, and you can do the pruning before/independently of having done any history following.

And it's not an issue with the current total hack, because the current total hack doesn't even _try_ to handle it, and doesn't even really try to do anything proper. The current hack is very much by design was a "hey, this is about as good as CVS/SVN could ever do", rather than anything that has any good design.

		Linus
Previous: Jeff KingNext: Jeff King
Message 8 of 12 in “Git log follow question”
  1. Albert KrawczykMay 14, 2010
  2. Bo YangMay 14, 2010
  3. Jeff KingMay 14, 2010
  4. Linus TorvaldsMay 14, 2010
  5. Martin LanghoffMay 14, 2010
  6. Linus TorvaldsMay 14, 2010
  7. Jeff KingMay 25, 2010
  8. Linus TorvaldsMay 25, 2010
  9. Jeff KingMay 26, 2010
  10. Linus TorvaldsMay 26, 2010
  11. Albert KrawczykMay 14, 2010
  12. Albert KrawczykMay 14, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.