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

Re: Git log follow question

From
Jeff King <peff@peff.net>
Date
May 14, 2010, 04:37 UTC
Message-ID
<20100514043704.GC6075@coredump.intra.peff.net>
In-Reply-To
<006d01caf300$703e96a0$50bbc3e0$@burgmann.anu.edu.au>
On Fri, May 14, 2010 at 10:57:34AM +1000, Albert Krawczyk wrote:
Show 16 quoted lines
> I'm having an issue understanding the way git log --follow works with git
> log --parents
>
> When I run
> git log --parents --pretty=format:Commit:%H%nParent:%P%n%n alloc.c
> I get:
> Commit:4b25d091ba53c758fae0096b8c0662371857b9d9
> Parent:100c5f3b0b27ec6617de1a785c4ff481e92636c1
>
> [...]
>
> When I try to run git log --parents --follow I get this:
> git log --parents --follow --pretty=format:Commit:%H%nParent:%P%n%n alloc.c
>
> Commit:4b25d091ba53c758fae0096b8c0662371857b9d9
> Parent:75b44066f3ed7cde238cdea1f0bf9e2f1744c820

Hmm. The actual parent is 75b44066. You get 100c5f in the first case because basic revision path-limiting simplifies the history graph to remove uninteresting commits (and rewrites the parents).

So the answer isn't _wrong_ exactly, but it is less useful. Seeing the simplified graph is generally what we want. This is a limitation of the way --follow is implemented. It turns off history pruning because our list of what to prune will be changing over time.

Probably we would have to special-case the FOLLOW_RENAMES code to rewrite the parent list before display.

I'm cc'ing Linus, who has more of a clue in both of those areas than I do.

-Peff
Previous: Bo YangNext: Linus Torvalds
Message 3 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.