threads / bug / 6295

Bug in git-status with non-ascii characters:

Subject: Bug in git-status with non-ascii characters:

## tl;dr

6 messages between Jan 9, 2007 and Jan 9, 2007.

replies: 5people: 5as markdown or json

Brian Gernhardt· Jan 9, 2007, 05:09 UTC · lore
`git status` always reports the following:

----- 8< ----- # On branch refs/heads/master # Untracked files: # (use "git add <file>..." to incrementally add content to commit) # # gitweb/test/Märchen no changes added to commit (use "git add" and/or "git commit [-a|-i|- o]") ----- 8< -----

When I do `rm gitweb/test/M<tab>` to remove this apparently unneeded file, `git status` reports:

----- 8< ----- # On branch refs/heads/master # Changed but not added: # (use "git add <file>..." to incrementally add content to commit) # # deleted: gitweb/test/Märchen # no changes added to commit (use "git add" and/or "git commit [-a|-i|- o]") ----- 8< -----

This is on Mac OS X, file system is HFS+ (Journaled). Is this expected? I can't figure out why it's happening.

~~ Brian
Shawn O. Pearce· Jan 9, 2007, 05:28 UTC · re: Brian Gernhardt · lore

Re: Bug in git-status with non-ascii characters:

Brian Gernhardt <benji@silverinsanity.com> wrote:
> This is on Mac OS X, file system is HFS+ (Journaled).  Is this  
> expected?  I can't figure out why it's happening.
There's a bug in the Mac OS X filesystem apparently.

Git created the file with one encoding. Later when Git does a readdir() to find out what files are in the directory Mac OS X is returning it with a different encoding. There's more details in the list archives; all I know is Mac OS X is broken here. And we Mac users get to suffer...

P.S. I'm also a Mac OS X user. I've gotten used to that file showing up and just visually ignore it now. *sigh*

-- 
Shawn.
Brian Gernhardt· Jan 9, 2007, 05:35 UTC · re: Shawn O. Pearce · lore

Re: Bug in git-status with non-ascii characters:

On Jan 9, 2007, at 12:28 AM, Shawn O. Pearce wrote:
Show 7 quoted lines
> There's a bug in the Mac OS X filesystem apparently.
>
> Git created the file with one encoding.  Later when Git does a
> readdir() to find out what files are in the directory Mac OS X is
> returning it with a different encoding.  There's more details in
> the list archives; all I know is Mac OS X is broken here.  And we
> Mac users get to suffer...

D'oh. RTFL? I should have known better minds than I had looked at this already.

> P.S. I'm also a Mac OS X user.  I've gotten used to that file
> showing up and just visually ignore it now.  *sigh*

I'm pretty used to it showing up, I was just poking around git (see recent patches) and thought about tracking it down.

~~ Brian
Juergen Ruehle· Jan 9, 2007, 05:39 UTC · re: Brian Gernhardt · lore

Re: Bug in git-status with non-ascii characters:

Brian Gernhardt writes:
 > `git status` always reports the following:
 > 
 > ----- 8< -----
 > # On branch refs/heads/master
 > # Untracked files:
 > #   (use "git add <file>..." to incrementally add content to commit)
 > #
 > #       gitweb/test/Märchen
 > no changes added to commit (use "git add" and/or "git commit [-a|-i|- 
 > o]")
 > ----- 8< -----
 > 
 > When I do `rm gitweb/test/M<tab>` to remove this apparently unneeded  
 > file, `git status` reports:
 > 
 > ----- 8< -----
 > # On branch refs/heads/master
 > # Changed but not added:
 > #   (use "git add <file>..." to incrementally add content to commit)
 > #
 > #       deleted:    gitweb/test/Märchen
 > #
 > no changes added to commit (use "git add" and/or "git commit [-a|-i|- 
 > o]")
 > ----- 8< -----
 > 
 > This is on Mac OS X, file system is HFS+ (Journaled).  Is this  
 > expected?  I can't figure out why it's happening.

It's a known problem with HFS+: it uses different byte sequences to identify the same file. Therefore git finds gitweb/test/Märchen unchanged but also a gitweb/test/Märchen in the working directory using a different byte sequence for the name as reported in status. If you delete the file git doesn't find the file any longer and reports that in status as well.

Wolfgang Fischer· Jan 9, 2007, 14:14 UTC · re: Juergen Ruehle · lore

Re: Bug in git-status with non-ascii characters:

On 09.01.2007, at 06:39, Juergen Ruehle wrote:
Show 36 quoted lines
> Brian Gernhardt writes:
>> `git status` always reports the following:
>>
>> ----- 8< -----
>> # On branch refs/heads/master
>> # Untracked files:
>> #   (use "git add <file>..." to incrementally add content to commit)
>> #
>> #       gitweb/test/Märchen
>> no changes added to commit (use "git add" and/or "git commit [-a|-i|-
>> o]")
>> ----- 8< -----
>>
>> When I do `rm gitweb/test/M<tab>` to remove this apparently unneeded
>> file, `git status` reports:
>>
>> ----- 8< -----
>> # On branch refs/heads/master
>> # Changed but not added:
>> #   (use "git add <file>..." to incrementally add content to commit)
>> #
>> #       deleted:    gitweb/test/Märchen
>> #
>> no changes added to commit (use "git add" and/or "git commit [-a|-i|-
>> o]")
>> ----- 8< -----
>>
>> This is on Mac OS X, file system is HFS+ (Journaled).  Is this
>> expected?  I can't figure out why it's happening.
>
> It's a known problem with HFS+: it uses different byte sequences to
> identify the same file. Therefore git finds gitweb/test/Märchen
> unchanged but also a gitweb/test/Märchen in the working directory
> using a different byte sequence for the name as reported in status. If
> you delete the file git doesn't find the file any longer and reports
> that in status as well.

Since this problem is discussed every other week, how about changing the name of the test file to scheußlicher_Dateiname or so, since the sz-ligature does not have the problem of different UTF-8 normalization forms. It wont fix HFS+, but since HFS+ is designed to accept either UTF-8 normalization form and returning just NFD, nobody will change/fix HFS+ anyway.

	Wolfgang
Johannes Schindelin· Jan 9, 2007, 14:48 UTC · re: Wolfgang Fischer · lore

Re: Bug in git-status with non-ascii characters:

Hi,
On Tue, 9 Jan 2007, Wolfgang Fischer wrote:
> Since this problem is discussed every other week, how about changing the 
> name of the test file to scheußlicher_Dateiname or so, since the 
> sz-ligature does not have the problem of different UTF-8 normalization 
> forms.
Good idea! But I'd name it "Oane-Maß" instead ;-)

Ciao, Dscho

← back to recent threads