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

Problems with extra files on git filter-branch when core.ignorecase is true

From
Simeon Maxein <smaxein@googlemail.com>
Date
Aug 28, 2010, 22:21 UTC
Message-ID
<AANLkTinEYNxKAAhq2O3joNYYrAmr=zRrUR3BakircnJW@mail.gmail.com>

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:

Show 25 quoted lines
> ~$ 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
Message 1 of 1 in “Problems with extra files on git filter-branch when core.ignorecase is true”
  1. Simeon MaxeinAug 28, 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.