threads / bug / 31736

Bug report

Subject: Bug report

## tl;dr

5 messages between Oct 5, 2012 and Oct 5, 2012.

replies: 4people: 3as markdown or json

Муковников Михаил· Oct 5, 2012, 10:13 UTC · lore
There's a problem using git with files having cyrillic 'й' in their name, git just can't track them.

uname: Darwin 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64 git version: 1.7.12.1 (from macports)

Steps to reproduce:
- git init
- touch test_й
- git status (should be "untracked files present")
- git add test_й
- git status

# Untracked files: # (use "git add <file>..." to include in what will be committed) # # "test_\320\270\314\206" nothing added to commit but untracked files present (use "git add" to track)

Could this be helped somehow?
Konstantin Khomoutov· Oct 5, 2012, 10:32 UTC · re: Муковников Михаил · lore

Re: Bug report

On Fri, 5 Oct 2012 14:13:49 +0400 Муковников Михаил <m.mukovnikov@gmail.com> wrote:

Show 22 quoted lines
> There's a problem using git with files having cyrillic 'й' in their
> name, git just can't track them.
> 
> uname: Darwin 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25
> 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64 git
> version: 1.7.12.1 (from macports)
> 
> Steps to reproduce:
> - git init
> - touch test_й
> - git status (should be "untracked files present")
> - git add test_й
> - git status
> 
> # Untracked files:
> #   (use "git add <file>..." to include in what will be committed)
> #
> #	"test_\320\270\314\206"
> nothing added to commit but untracked files present (use "git add" to
> track)
> 
> Could this be helped somehow?--

What "this"? If you mean displaying escapes for UTF-8 bytes representing that letter "й", then try setting core.quotepath to false for this repository and see if that helps.

More info can be found in the git-config manual page.
Carlos Martín Nieto· Oct 5, 2012, 10:47 UTC · re: Konstantin Khomoutov · lore

Re: Bug report

Konstantin Khomoutov <flatworm@users.sourceforge.net> writes:
Show 29 quoted lines
> On Fri, 5 Oct 2012 14:13:49 +0400
> Муковников Михаил <m.mukovnikov@gmail.com> wrote:
>
>> There's a problem using git with files having cyrillic 'й' in their
>> name, git just can't track them.
>> 
>> uname: Darwin 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25
>> 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64 git
>> version: 1.7.12.1 (from macports)
>> 
>> Steps to reproduce:
>> - git init
>> - touch test_й
>> - git status (should be "untracked files present")
>> - git add test_й
>> - git status
>> 
>> # Untracked files:
>> #   (use "git add <file>..." to include in what will be committed)
>> #
>> #	"test_\320\270\314\206"
>> nothing added to commit but untracked files present (use "git add" to
>> track)
>> 
>> Could this be helped somehow?--
>
> What "this"?  If you mean displaying escapes for UTF-8 bytes
> representing that letter "й", then try setting core.quotepath to false
> for this repository and see if that helps.
Notice the 'git add test_й'. The problem is that git reports it as untracked.

Михаил, is this the whole output or do you also see a differently-escaped version of the filename under tracked files? Does this problem not show up if you use 'git add -A' or 'git add .' instead of typing the name? If so, this happens because HFS+ stores and reports names differently than the way we told it to store it, so git sees a different set of bytes than what it's expecting and considers it a different file.

With a recent version of git, you can set the core.precomposeunicode config setting to true, which deals with this situation. This tells git to transform the data it gets from the filesystem to the format that everyone else uses, which helps not only this, but also the 'git add .' case, so git stores the filename in the format the same way that other OSs expect to find.

   cmn
Муковников Михаил· Oct 5, 2012, 11:03 UTC · re: Carlos Martín Nieto · lore

Re: Bug report

Carlos, thank you very much, core.precomposeunicode works just like you said. And you're right, it seems the problem is in HFS+, 'git add .' worked as well, so did even 'git add test_*'. The problem seems solved.

05.10.2012, в 14:47, cmn@elego.de (Carlos Martín Nieto) написал(а):
Show 50 quoted lines
> Konstantin Khomoutov <flatworm@users.sourceforge.net> writes:
> 
>> On Fri, 5 Oct 2012 14:13:49 +0400
>> Муковников Михаил <m.mukovnikov@gmail.com> wrote:
>> 
>>> There's a problem using git with files having cyrillic 'й' in their
>>> name, git just can't track them.
>>> 
>>> uname: Darwin 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25
>>> 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64 git
>>> version: 1.7.12.1 (from macports)
>>> 
>>> Steps to reproduce:
>>> - git init
>>> - touch test_й
>>> - git status (should be "untracked files present")
>>> - git add test_й
>>> - git status
>>> 
>>> # Untracked files:
>>> #   (use "git add <file>..." to include in what will be committed)
>>> #
>>> #	"test_\320\270\314\206"
>>> nothing added to commit but untracked files present (use "git add" to
>>> track)
>>> 
>>> Could this be helped somehow?--
>> 
>> What "this"?  If you mean displaying escapes for UTF-8 bytes
>> representing that letter "й", then try setting core.quotepath to false
>> for this repository and see if that helps.
> 
> Notice the 'git add test_й'. The problem is that git reports it as untracked.
> 
> Михаил, is this the whole output or do you also see a
> differently-escaped version of the filename under tracked files? Does
> this problem not show up if you use 'git add -A' or 'git add .' instead
> of typing the name? If so, this happens because HFS+ stores and reports
> names differently than the way we told it to store it, so git sees a
> different set of bytes than what it's expecting and considers it a
> different file.
> 
> With a recent version of git, you can set the core.precomposeunicode
> config setting to true, which deals with this situation. This tells git
> to transform the data it gets from the filesystem to the format that
> everyone else uses, which helps not only this, but also the 'git add .'
> case, so git stores the filename in the format the same way that other
> OSs expect to find.
> 
>   cmn
Муковников Михаил· Oct 5, 2012, 10:52 UTC · re: Konstantin Khomoutov · lore

Re: Bug report

Hey, Konstantin! Thanks for your reply. My bad, I described the problem not very well. I don't mind displaying escapes etc. (core.quotepath just makes "\320\270\314\206" be "й" and that's it), the problem is that git cannot track files with cyrillic "й" in their name. I created a file, added it but git writes it's still untracked, and it seems there's no way to track it.

05.10.2012, в 14:32, Konstantin Khomoutov <flatworm@users.sourceforge.net> написал(а):
Show 31 quoted lines
> On Fri, 5 Oct 2012 14:13:49 +0400
> Муковников Михаил <m.mukovnikov@gmail.com> wrote:
> 
>> There's a problem using git with files having cyrillic 'й' in their
>> name, git just can't track them.
>> 
>> uname: Darwin 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25
>> 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64 git
>> version: 1.7.12.1 (from macports)
>> 
>> Steps to reproduce:
>> - git init
>> - touch test_й
>> - git status (should be "untracked files present")
>> - git add test_й
>> - git status
>> 
>> # Untracked files:
>> #   (use "git add <file>..." to include in what will be committed)
>> #
>> #	"test_\320\270\314\206"
>> nothing added to commit but untracked files present (use "git add" to
>> track)
>> 
>> Could this be helped somehow?--
> 
> What "this"?  If you mean displaying escapes for UTF-8 bytes
> representing that letter "й", then try setting core.quotepath to false
> for this repository and see if that helps.
> 
> More info can be found in the git-config manual page.

← back to recent threads