From: Junio C Hamano <gitster@pobox.com>
To: David Turner <dturner@twopensource.com>
Cc: git@vger.kernel.org, David Turner <dturner@twitter.com>
Subject: Re: [PATCH 2/2] ignorecase: Fix git mv on insensitive filesystems
Date: Thu, 08 May 2014 13:55:57 -0700 [thread overview]
Message-ID: <xmqq4n102dnm.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1399581623.11843.105.camel@stross> (David Turner's message of "Thu, 08 May 2014 13:40:23 -0700")
David Turner <dturner@twopensource.com> writes:
>> Hmm, I would find it easier to read if it were:
>>
>> ... if (lstat(dst, &st) == 0 &&
>> !(ignore_case && !strcasecmp(src, dst))) {
>>
>> That is, "it is an error for dst to exist, unless we are on a case
>> insensitive filesystem and src and dst refer to the same file.", but
>> maybe it is just me.
>
> I personally dislike the double negative. I also considered breaking it
> out into a little function with a self-documenting name -- does that
> sound better?
No, it shows that it is just me. I did not say that the original is
unreadable.
>> More importantly, what is the end-user visible effect of this
>> change? Is it fair to summarize it like this?
>>
>> On a case-insensitive filesystem, "mv hello.txt Hello.txt"
>> always trigger the "dst already exists" error, because both
>> names refer to the same file to MS-DOS, requiring the user to
> ^^^^^^
> (I have not actually tested on Windows; I tested on the Mac since that's
> what I have handy)
>
>> pass the "--force" option. Allow it without "--force".
>
> Yes.
>
>> Overwriting an existing file with "mv hello.txt Hello.txt" on a case
>> sensitive filesystem *is* an unusual operation, and that is the
>> reason why we require "--force" to make sure that the user means it.
>> I have a slight suspicion that the same "mv hello.txt Hello.txt" on
>> a case insensitive filesystem, where two names are known (to the end
>> user of such a filesystem) to refer to the same path would equally
>> be a very unusual thing to do, and such an operation may deserve a
>> similar safety precaution to make sure that the user really meant to
>> do so by requiring "--force".
>>
>> So, I dunno.
>
> The argument against --force is that git's behavior should not
> significantly differ between sensitive and insensitive filesystems
> (where possible). I do not see a case-changing rename as unusual on a
> case-insensitive filesystem; these filesystems typically preserve case,
> and a user might reasonably care about the case of a filename either for
> aesthetic reasons or for functionality on sensible filesystems (e.g.
> developers who work on Macs but deploy on GNU/Linux, as is quite
> common).
>
> The Mac's interface itself provides conflicting evidence: on one hand,
> we might expect git mv to work like plain mv: nothing special is needed
> to do a case-changing mv). On the other hand, in the Finder, attempting
> a case-changing rename causes an error message (which there is no way to
> get around other than the two-rename dance). I read this as "ordinary
> users never intentionally change the case of files, but developers
> sometimes do", but that's not the only possible reading.
>
> I myself am not actually a Mac user; I simply support a bunch of Mac
> users (which is where the merge bug came from). So I don't know what
> Mac users would prefer. Maybe there are some on the git mailing list?
>
> I also have not tried on Windows. I put in an email to the one
> Windows-using friend I can think of to ask her to give Windows Explorer
> (or whatever it's called these days) a try. My guess (based on a quick
> Google search) would be is that it works without error, but I will send
> an update if I hear otherwise.
Alright. Thanks for sanity checking.
I've already queued your patch as-is when I was composing the
message you responded to and today's integration cycle is already
going, so unless other people have ideas to convince us both that
this is a bad idea, all is well without any further action.
Thanks.
next prev parent reply other threads:[~2014-05-08 20:56 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-29 19:02 Bug: Case-insensitive filesystems can cause merge and checkout problems David Turner
2014-05-02 0:21 ` [PATCH] merge-recursive.c: Fix case-changing merge bug David Turner
2014-05-06 17:07 ` Junio C Hamano
2014-05-06 17:36 ` David Turner
2014-05-06 19:46 ` Junio C Hamano
2014-05-06 22:59 ` [PATCH 1/2] merge-recursive.c: Fix case-changing merge dturner
2014-05-06 22:59 ` [PATCH 2/2] ignorecase: Fix git mv on insensitive filesystems dturner
2014-05-07 6:17 ` Johannes Sixt
2014-05-07 16:42 ` David Turner
2014-05-07 17:46 ` Junio C Hamano
2014-05-07 18:01 ` David Turner
2014-05-08 6:37 ` Johannes Sixt
2014-05-08 8:55 ` Torsten Bögershausen
2014-05-08 17:23 ` [PATCH 0/2] " dturner
2014-05-08 17:23 ` [PATCH 1/2] merge-recursive.c: Fix case-changing merge dturner
2014-05-08 19:45 ` Junio C Hamano
2014-05-08 17:23 ` [PATCH 2/2] ignorecase: Fix git mv on insensitive filesystems dturner
2014-05-08 19:54 ` Junio C Hamano
2014-05-08 20:40 ` David Turner
2014-05-08 20:55 ` Junio C Hamano [this message]
2014-05-08 1:22 ` brian m. carlson
2014-05-07 18:01 ` [PATCH 1/2] merge-recursive.c: Fix case-changing merge Junio C Hamano
2014-05-07 18:13 ` Jonathan Nieder
2014-05-07 20:53 ` Junio C Hamano
2014-05-08 20:48 [PATCH 2/2] ignorecase: Fix git mv on insensitive filesystems Thomas Braun
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=xmqq4n102dnm.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox.com \
--cc=dturner@twitter.com \
--cc=dturner@twopensource.com \
--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).