Re: Git log follow question
From: Bo Yang <hidden>
Date: 2016-06-15 22:48:48
Hi Albert, On Fri, May 14, 2010 at 8:57 AM, Albert Krawczyk [off-list ref] wrote:
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