When a file is created during a conflicting merge merge and then committed, 'git log --follow' shows no history, while 'git log' behaves correctly.
Steps to reproduce: 1. Make a conflicting merge. 2. While manually resolving the merge, create a file. 3. Commit the new file together with the merge resolve.
More precisely (trivial outputs are skipped): # git init # echo 'initial content' > a.txt # git add . # git commit -m "initial"
# git checkout -b mybranch Switched to a new branch 'mybranch' # echo 'branchy' > a.txt # git add . # git commit -m "branchy to a"
# git checkout master # echo 'mastery' > a.txt # git add . # git commit -m "mastery to a"
# git merge mybranch Auto-merging a.txt CONFLICT (content): Merge conflict in a.txt Automatic merge failed; fix conflicts and then commit the result. # echo 'content' > b.txt # git add . # git commit -m "resolved merge for a.txt, added b.txt"
# git log b.txt commit 1bf7b74c8e53ed065dd615771a602de803f87b6f Merge: 7b9b988 a82daa2 Author: Kirill Likhodedov <kirill.likhodedov@jetbrains.com> Date: Fri Sep 17 16:01:24 2010 +0400
resolved merge for a.txt, added b.txt # git log --follow b.txt #
I know that Linus doesn't like following renames :) but in this case there are no renames at all. It seems to be just a bug in --follow.
Btw, after additional commits to b.txt, the history gets not empty, but the merge commit is still not listed there.
Thanks.
---------------------------------- Kirill Likhodedov JetBrains, Inc http://www.jetbrains.com "Develop with pleasure!"