From: Junio C Hamano <gitster@pobox.com>
To: Derrick Stolee <stolee@gmail.com>
Cc: Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org, szeder.dev@gmail.com, newren@gmail.com,
Derrick Stolee <dstolee@microsoft.com>
Subject: Re: [PATCH 1/1] sparse-checkout: respect core.ignoreCase in cone mode
Date: Wed, 11 Dec 2019 12:00:03 -0800 [thread overview]
Message-ID: <xmqqeexaocos.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <9dbf6d43-ac1e-4790-84e5-4829d21f5fdb@gmail.com> (Derrick Stolee's message of "Wed, 11 Dec 2019 14:11:32 -0500")
Derrick Stolee <stolee@gmail.com> writes:
> I'm trying to find a way around these two ideas:
>
> 1. The index is case-sensitive, and the sparse-checkout patterns are
> case-sensitive.
OK. The latter is local to the repository and not shared to the
world where people with case sensitive systems would live, right?
> 2. If a filesystem is case-insensitive, most index-change operations
> already succeed with incorrect case, especially with core.ignoreCase
> enabled.
I am not sure about "incorrect", though.
My understanding is that modern case-insensitive systems are not
information-destroying [*1*]. A new file you create as "ReadMe.txt"
on your filesystem would be seen in that mixed case spelling via
readdir() or equivalent, so adding it to the index as-is would
likely be in the "correct" case, no? If, after adding that path to
the index, you did "rm ReadMe.txt" and created "README.TXT", surely
we won't have both ReadMe.txt and README.TXT in the index with
ignoreCase set, and keep using ReadMe.txt that matches what you
added to the index. I am not sure which one is the "incorrect" case
in such a scenario.
> The approach I have is to allow a user to provide a case that does not
> match the index, and then we store the pattern in the sparse-checkout
> that matches the case in the index.
Yes, I understood that from your proposed log message and cover
letter. They were very clearly written.
But imagine that your user writes ABC in the sparse pattern file,
and there is no abc anything in the index in any case permutations.
When you check out a branch that has Abc, shouldn't the pattern ABC
affect the operation just like a pattern Abc would on a case
insensitive system?
Or are end users perfectly aware that the thing in that branch is
spelled "Abc" and not "ABC" (the data in Git does---it comes from a
tree object that is case sensitive)? If so, then the pattern ABC
should not affect the subtree whose name is "Abc" even on a case
insensitive system.
I am not sure what the design of this part of the system expects out
of the end user. Perhaps keeping the patterns case insensitive and
tell the end users to spell them correctly is the right way to go, I
guess, if it is just the filesystem that cannot represente the cases
correctly at times and the users are perfectly capable of telling
the right and wrong cases apart.
But then I am not sure why correcting misspelled names by comparing
them with the index entries is a good idea, either.
> It sounds like you are preferring this second option, despite the
> performance costs. It is possible to use a case-insensitive hashing
> algorithm when in the cone mode, but I'm not sure about how to do
> a similar concept for the normal mode.
I have no strong preference, other than that I prefer to see things
being done consistently. Don't we already use case folding hash
function to ensure that we won't add duplicate to the index on
case-insensitive system? I suspect that we would need to do the
same, whether in cone mode or just a normal sparse-checkout mode
consistently.
Thanks.
[Footnote]
*1* ... unlike HFS+ where everything is forced to NKD and a bit of
information---whether the original was in NKC or NKD---is discarded
forever.
next prev parent reply other threads:[~2019-12-11 20:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-09 19:42 [PATCH 0/1] sparse-checkout: respect core.ignoreCase in cone mode Derrick Stolee via GitGitGadget
2019-12-09 19:43 ` [PATCH 1/1] " Derrick Stolee via GitGitGadget
2019-12-11 18:44 ` Junio C Hamano
2019-12-11 19:11 ` Derrick Stolee
2019-12-11 20:00 ` Junio C Hamano [this message]
2019-12-11 20:29 ` Derrick Stolee
2019-12-11 21:37 ` Junio C Hamano
2019-12-12 2:51 ` Derrick Stolee
2019-12-12 20:59 ` Derrick Stolee
2019-12-13 19:05 ` Junio C Hamano
2019-12-13 19:40 ` Derrick Stolee
2019-12-13 22:02 ` Junio C Hamano
2019-12-13 18:09 ` [PATCH v2 0/1] " Derrick Stolee via GitGitGadget
2019-12-13 18:09 ` [PATCH v2 1/1] " Derrick Stolee via GitGitGadget
2019-12-13 19:58 ` [PATCH v2 0/1] " Junio C Hamano
2019-12-18 11:41 ` [PATCH " Ed Maste
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=xmqqeexaocos.fsf@gitster-ct.c.googlers.com \
--to=gitster@pobox.com \
--cc=dstolee@microsoft.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=newren@gmail.com \
--cc=stolee@gmail.com \
--cc=szeder.dev@gmail.com \
/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).