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

Bug: git log --follow doesn't show history for a file created while merge

From
Kirill Likhodedov <kirill.likhodedov@jetbrains.com>
Date
Sep 17, 2010, 12:13 UTC
Message-ID
<E68F7D53-50A6-4FD3-B176-600942B8A66C@jetbrains.com>
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!"

Message 1 of 1 in “Bug: git log --follow doesn't show history for a file created while merge”
  1. Kirill LikhodedovSep 17, 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.