Re: git: cannot rename foo to Foo on a case-insensitive filesystem (e.g. on Windows)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reece Dunn wrote:
On 28/08/07, Andreas Ericsson <ae@xxxxxx> wrote:
Reece Dunn wrote:
Hi,

Running the following:

    echo "hello" > foo
    git add foo && git commit -m "move test (1)"
    git mv foo Foo

using a case-insensitive filesystem (this was done running git 1.5.0.3
and git 1.5.1.3 on Windows using cygwin), I get the following error:

    fatal: destination exists, source=foo, destination=Foo

Are there any plans to support this on case-insensitive filesystems,
or is it going to remain broken?

It's going to remain in the state it is, although I disagree that that
state is broken. Adding case-sensitivity to a content tracker on a
case-insensitive file system would be quite a lot of work for a very
small gain.

I'm not suggesting adding case sensitivity to the content tracker.


But without case sensitivity in the tracker there's no way "mv foo Foo"
can work on a filesystem level. You'd have to jump some sort of hoop.

As usual, should you present some small and elegant piece of code that
makes git capable of dealing with this while running with no slowdown
at all on sane systems, I'm sure it'd be accepted, or at least very
thoroughly discussed by the heavy names on the list.

I have tried the following:

    git mv foo foo.tmp
    git mv foo.tmp Foo

which correctly reports:

    renamed: foo -> Foo


Yes, because then you give the filesystem some leeway in that it
doesn't have to create two files with conflicting hash entries.
And that's the hoop, I suspect.

Some really insane filesystems have the odd ability to report case
sensitively while not actually supporting it (VFAT, I think, displays
this absurd capability). Either way, the tools manipulating the file-
system still only sees what the filesystem reports, so...


Without the code, it's just an ugly can of worms that nobody wants to
open.

I haven't got any code yet, but from the analysis above, it would be a
special case in the mv command when the files are the same and the
case is different.

However, given that the double move works as expected, I don't see
this as being a big issue.


True. What happens when you "git mv -f foo Foo"?

--
Andreas Ericsson                   andreas.ericsson@xxxxxx
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux