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

Re: Git log follow question

From
Bo Yang <struggleyb.nku@gmail.com>
Date
May 14, 2010, 04:16 UTC
Message-ID
<AANLkTilFn8qugzcGgr-Ooe5PZsSxmJOiubbG7sAwW1Ft@mail.gmail.com>
In-Reply-To
<006d01caf300$703e96a0$50bbc3e0$@burgmann.anu.edu.au>

Hi Albert, On Fri, May 14, 2010 at 8:57 AM, Albert Krawczyk <albert@burgmann.anu.edu.au> wrote:

Show 6 quoted lines
> As you can see git log --parents and git log --follow --parents produce very
> different results, and as far as I can tell they should produce identical
> outputs.
>
> Could somebody tell me if I'm doing something wrong with the syntax? Or have
> I stumbled onto a quirk I fail to understand?

The problem you encountered is something about parent rewriting. That's when git do a revision walk it will *modify* the actual parents of a commit according on the command line options. When you invoke, git log --parents , the parents rewriting mechanism is on. Take you have five commits: commit1 <- commit2 <- commit3 <- 4 <- 5 And only commit 5 and commit 2 change the file alloc.c. When you run 'git log --parents alloc.c', the actual parent of commit 5 will be modified to commit2. When you run git without --parents, commit 5's parent will still be commit 4. And when '--follow' is given, parent rewriting mechanism will be shut down, so you get two different output.

For another words, I don't understand why we shut down the parent rewriting when '--follow' given. This make users confusing and also make --graph inpossible to work with '--follow'...

Regards! Bo

-- 
My blog: http://blog.morebits.org
Previous: Albert KrawczykNext: Jeff King
Message 2 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.