git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tao Klerks <tao@klerks.biz>
To: git <git@vger.kernel.org>
Subject: Git apply fails on case-only rename on case-insensitive filesystem
Date: Wed, 8 Jun 2022 15:07:05 +0200	[thread overview]
Message-ID: <CAPMMpojwV+f=z9sgc_GaUOTFBCUVdbrGW8WjatWWmC3WTcsoXw@mail.gmail.com> (raw)

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

             reply	other threads:[~2022-06-08 13:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08 13:07 Tao Klerks [this message]
2022-06-08 22:27 ` Git apply fails on case-only rename on case-insensitive filesystem brian m. carlson
2022-06-09  4:57   ` Tao Klerks

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPMMpojwV+f=z9sgc_GaUOTFBCUVdbrGW8WjatWWmC3WTcsoXw@mail.gmail.com' \
    --to=tao@klerks.biz \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).