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

Git apply fails on case-only rename on case-insensitive filesystem

From
Tao Klerks <tao@klerks.biz>
Date
Jun 8, 2022, 13:07 UTC
Message-ID
<CAPMMpojwV+f=z9sgc_GaUOTFBCUVdbrGW8WjatWWmC3WTcsoXw@mail.gmail.com>
Hi folks,

I just found out that "git apply" has a faulty existence check on case-insensitive filesystems (or, at least, windows?).

Simplest repro I could come up with:

git init renamefun cd renamefun echo "Test" > file1 git add . git commit -m "first commit" git mv file1 File1 git commit -m "second commit" git checkout master~1 git diff master~1..master | git apply

-> error: error: File1: already exists in working directory

(on linux, the same sequence of commands completes correctly)

I was able to work around this for my purposes by avoiding rename detection on the diff, and only passing the "Add" (and "Modify") operations through to the "apply", after having separately/manually handled the deletions.

Is this a known issue that someone might be working on, or worth digging into / trying to fix?

Thanks, Tao

Next: brian m. carlson
Message 1 of 3 in “Git apply fails on case-only rename on case-insensitive filesystem”
  1. Tao KlerksJun 8, 2022
  2. brian m. carlsonJun 8, 2022
  3. Tao KlerksJun 9, 2022

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.