Problems with extra files on git filter-branch when core.ignorecase is true
From: Simeon Maxein <hidden>
Date: 2016-06-15 22:49:24
Today when trying to change the contents of a repository with git filter-branch, a tool that was run on a part of the working tree for each version reported an extra file that couldn't be accounted for. After some testing and a small discussion on the irc channel, I was able to come up with the following scenario to reproduce the issue. The test was performed under Ubuntu with Git 1.7.0.4 on a case sensitive file system:
~$ mkdir gittest ~$ cd gittest ~/gittest$ git init Initialized empty Git repository in /home/user/gittest/.git/ ~/gittest$ git config core.ignorecase true ~/gittest$ echo 'foo' > testfile.txt ~/gittest$ git add testfile.txt ~/gittest$ git commit -m "initial commit" [master (root-commit) 794888c] initial commit 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 testfile.txt ~/gittest$ git rm testfile.txt rm 'testfile.txt' ~/gittest$ echo 'bar' > testFile.txt ~/gittest$ git add testFile.txt ~/gittest$ git commit -m "additional commit" [master a669956] additional commit 2 files changed, 1 insertions(+), 1 deletions(-) create mode 100644 testFile.txt delete mode 100644 testfile.txt ~/gittest$ git filter-branch --tree-filter 'ls' master Rewrite 794888cdbe107aa7408cc5ed4132dcd3bc2753c8 (1/2)testfile.txt Rewrite a66995628af5710828a6a59628553938bc30ee37 (2/2)testfile.txt testFile.txt WARNING: Ref 'refs/heads/master' is unchanged
In the second rewrite line, I would only expect testFile.txt to appear, regardless of the core.ignorecase setting. On a case insensitive filesystem the above example works correctly. It might seem strange to set core.ignorecase to true on a case sensitive filesystem, however, this issue also appears when using a (case sensitive) tmpfs temp directory to filter a case insensitive repository. Thanks in advance for your help. Simeon