Re: [PATCH/RFC v3 6/8] Add case insensitivity support when using git ls-files
- From
Joshua Jensen <jjensen@workspacewhiz.com>
- Date
- Oct 4, 2010, 16:49 UTC
- Message-ID
- <4CAA0598.9080409@workspacewhiz.com>
- In-Reply-To
- <201010041802.57398.robin.rosenberg@dewire.com>
----- Original Message ----- From: Robin Rosenberg Date: 10/4/2010 10:02 AM
Show 24 quoted lines
> söndagen den 3 oktober 2010 11.56.44 skrev Ævar Arnfjörð Bjarmason:
>> From: Joshua Jensen<jjensen@workspacewhiz.com>
>>
>> When mydir/filea.txt is added, mydir/ is renamed to MyDir/, and
>> MyDir/fileb.txt is added, running git ls-files mydir only shows
>> mydir/filea.txt. Running git ls-files MyDir shows MyDir/fileb.txt.
>> Running git ls-files mYdIR shows nothing.
>>
>> With this patch running git ls-files for mydir, MyDir, and mYdIR shows
>> mydir/filea.txt and MyDir/fileb.txt.
>> ---
>> dir.c | 38 ++++++++++++++++++++++++++------------
>> 1 files changed, 26 insertions(+), 12 deletions(-)
>>
>> diff --git a/dir.c b/dir.c
>> index cf8f65c..53aa4f3 100644
>> --- a/dir.c
>> +++ b/dir.c
>> @@ -107,16 +107,30 @@ static int match_one(const char *match, const char
>> + if (ignore_case) {
>> + for (;;) {
>> + unsigned char c1 = tolower(*match);
>> + unsigned char c2 = tolower(*name);
> Is anyone thinking "unicode" around here?On Windows, Unicode filenames are 16-bit wide characters. The current code doesn't handle them at all.
I do not know about other file systems and what Git actually handles. I was under the impression it didn't handle Unicode filenames well in general... ?
Josh