Skip to contentSkip to conversation

git and cyrillic branches

DISCUSSION иванов иван 5 participants 9 messages Jun 15, 2016 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

hello! there is problem vith git and cyrillic (utf-8) names of branches. branch creates perfectly, but when i clone this remote branch to local host, there are 2 bugs:
1) "git branch" doesnt show checked branch with asterisk (while on remote server it does)
2) "git push" gives 2 errors: "fatal: BRANCH_NAME cannot be resolved to branch." and "fatal: The remote end hung up unexpectedly"
thanks.

#1 lore raw
Quoted 7 lines · On Thu, 25 Jul 2013 15:19:48 +0300 иванов иван <[email protected]> wrote:

hello! there is problem vith git and cyrillic (utf-8) names of branches. branch creates perfectly, but when i clone this remote branch to local host, there are 2 bugs:
1) "git branch" doesnt show checked branch with asterisk (while on remote server it does)
2) "git push" gives 2 errors: "fatal: BRANCH_NAME cannot be resolved to branch." and "fatal: The remote end hung up unexpectedly" thanks.

Works for me across two Debian systems: both have Git 1.7.10.4; user accounts on both systems have LANG=en_US.UTF-8 configured in their environment.

Do both of your systems (local and remote) have an UTF-8-enabled (or encoding-agnostic, like "C") locale active?

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 13 lines · On Thu, 25 Jul 2013 17:06:41 +0400 ксовиран <[email protected]> wrote:
Quoted 13 lines
Quoted 8 lines

 hello! there is problem vith git and cyrillic (utf-8) names of branches. branch creates perfectly, but when i clone this remote branch to local host, there are 2 bugs:
 1) "git branch" doesnt show checked branch with asterisk (while on remote server it does)
 2) "git push" gives 2 errors: "fatal: BRANCH_NAME cannot be resolved to branch." and "fatal: The remote end hung up unexpectedly" thanks.

Works for me across two Debian systems: both have Git 1.7.10.4; user accounts on both systems have LANG=en_US.UTF-8 configured in their environment.

Quoted 6 lines
Quoted 2 lines

Do both of your systems (local and remote) have an UTF-8-enabled (or encoding-agnostic, like "C") locale active?

oh, yes indeed. i was pushing from mac to ubuntu, but ubuntu to ubuntu works fine. although #locale gives almost identical output, so it is something to work out. спасибо за помощь! 25.07.2013, 16:45,

I'm afraid, this might be not that simple: Git received certain tweaks to work around certain problems Mac OS X has (as I understand it) with handling UTF-8 on various filesystems it supports; in particular, see commits 76759c7dff53e8c84e975b88cb8245587c14c7ba [1]
and b856ad623e4f686815986c0b9341dd1bfd791e71 [2] which were released as part of v1.7.12.

So... I'm not sure, but I beleive these fixes might have been related to handling filenames in the work tree and the index only, not branches, as having branches with non-ASCII names is a weird idea to most developers, I think. So the question is: do you have Git >= 1.7.12 on your Mac OS X machine? If so, do you still experience this problem (I think that Macs do not have non-UTF-8 locales anyway, so this is unlikely the root cause).

P.S.
Please don't top-post as this breaks discussion flow and hence sucks.

1. https://github.com/git/git/commit/76759c7
2. https://github.com/git/git/commit/b856ad6

#4 lore raw

25.07.2013, 18:28, "Konstantin Khomoutov" <[email protected]>:

Quoted 36 lines
Quoted 12 lines · On Thu, 25 Jul 2013 17:06:41 +0400 ксовиран <[email protected]> wrote:
Quoted 12 lines
Quoted 8 lines

  hello! there is problem vith git and cyrillic (utf-8) names of branches. branch creates perfectly, but when i clone this remote branch to local host, there are 2 bugs:
  1) "git branch" doesnt show checked branch with asterisk (while on remote server it does)
  2) "git push" gives 2 errors: "fatal: BRANCH_NAME cannot be resolved to branch." and "fatal: The remote end hung up unexpectedly" thanks.

 Works for me across two Debian systems: both have Git 1.7.10.4; user accounts on both systems have LANG=en_US.UTF-8 configured in their environment.

Quoted 5 lines
Quoted 2 lines

 Do both of your systems (local and remote) have an UTF-8-enabled (or encoding-agnostic, like "C") locale active?

 oh, yes indeed. i was pushing from mac to ubuntu, but ubuntu to ubuntu works fine. although #locale gives almost identical output, so it is something to work out. спасибо за помощь! 25.07.2013, 16:45,

I'm afraid, this might be not that simple: Git received certain tweaks to work around certain problems Mac OS X has (as I understand it) with handling UTF-8 on various filesystems it supports; in particular, see commits 76759c7dff53e8c84e975b88cb8245587c14c7ba [1]
and b856ad623e4f686815986c0b9341dd1bfd791e71 [2] which were released as part of v1.7.12.

So... I'm not sure, but I beleive these fixes might have been related to handling filenames in the work tree and the index only, not branches, as having branches with non-ASCII names is a weird idea to most developers, I think.  So the question is: do you have Git >= 1.7.12 on your Mac OS X machine?  If so, do you still experience this problem (I think that Macs do not have non-UTF-8 locales anyway, so this is unlikely the root cause).

Quoted 5 lines

P.S.
Please don't top-post as this breaks discussion flow and hence sucks.

1. https://github.com/git/git/commit/76759c7
2. https://github.com/git/git/commit/b856ad6

there is nothing wrong with having branches with non-ASCII names as english is not the only language in the world. problem is still here, i've got ubuntu on VM and same shared git-folder causes this problem on Mac Os and no problems on Ubuntu. git version on Mac is 1.8.0.1 (on Ubuntu is 1.7.10.4)

#5 lore raw

On Thu, 25 Jul 2013 18:51:57 +0400
ксовиран <[email protected]> wrote:

[...]

Quoted 4 lines
Quoted 4 lines

I'm afraid, this might be not that simple: Git received certain tweaks to work around certain problems Mac OS X has (as I understand it) with handling UTF-8 on various filesystems it supports; in particular, see commits

[...]

Quoted 4 lines
Quoted 4 lines

So... I'm not sure, but I beleive these fixes might have been related to handling filenames in the work tree and the index only, not branches, as having branches with non-ASCII names is a weird idea to most developers, I think.

[...]

Quoted 2 lines

there is nothing wrong with having branches with non-ASCII names as english is not the only language in the world.

Well, this my remark was just to explain why the problem with branches which *are* files (well, unless they have become "packed refs") in the reference Git implementation, might had good chances to escape the scope of the tweaks being discussed. Of course, there's nothing wrong with non-ASCII branch names unless this impedes collaboration on a project which uses them.

Quoted 3 lines

problem is still here, i've got ubuntu on VM and same shared git-folder causes this problem on Mac Os and no problems on Ubuntu. git version on Mac is 1.8.0.1 (on Ubuntu is 1.7.10.4)

I hope someone possessing the necessary knowledge will look at it.

#6 lore raw
In reply to ксовиран

On Thu, 25 Jul 2013 18:51:57 +0400
ксовиран <[email protected]> wrote:

[...]

Quoted 7 lines
Quoted 7 lines

I'm afraid, this might be not that simple: Git received certain tweaks to work around certain problems Mac OS X has (as I understand it) with handling UTF-8 on various filesystems it supports; in particular, see commits 76759c7dff53e8c84e975b88cb8245587c14c7ba [1] and b856ad623e4f686815986c0b9341dd1bfd791e71 [2] which were released as part of v1.7.12.

[...]

And while we're at it, commit message of 76759c7 tells that in order for the fixes to work, the core.precomposedunicode configuration variable has to be set to 'true'. Did you do that? Did that help?

#7 lore raw
In reply to ксовиран
Quoted 2 lines · ксовиран

problem is still here, i've got ubuntu on VM and same shared git-folder causes this problem on Mac Os and no problems on Ubuntu. git version on Mac is 1.8.0.1 (on Ubuntu is 1.7.10.4)

OSX filesystem code canonicalizes UTF-8 filenames in a way that disagrees with GIT's design (and Linux's fs design) which considers a filename to be a bag of bytes better left alone.

So the ugly fixes applied to filenames need to be applied too to refs, I guess.

Are you using packed refs? That's probably a good workaround in the meantime. Using packed refs, git will not need to store the branchname as a filename...

cheers,

m
--
[email protected]
- ask interesting questions
- don't get distracted with shiny stuff - working code first ~ http://docs.moodle.org/en/User:Martin_Langhoff

#8 lore raw
In reply to иванов иван
Quoted 4 lines · иванов иван

hello! there is problem vith git and cyrillic (utf-8) names of branches. branch creates perfectly, but when i clone this remote branch to local host, there are 2 bugs:
1) "git branch" doesnt show checked branch with asterisk (while on remote server it does)
2) "git push" gives 2 errors: "fatal: BRANCH_NAME cannot be resolved to branch." and "fatal: The remote end hung up unexpectedly"
thanks.

It could be helpful if you could provide more information. The best could be a step-by-step instruction using a some "mini repo", so that we we can reproduce the problem.
I have done an illustrating example using UTF-8,
(not cyrillic, I don't have these letters on my keyboard ;-)

tb@linux:~$ mkdir cyrill
tb@linux:~$ cd cyrill/
tb@linux:~/cyrill$ git init
Initialized empty Git repository in /home/tb/cyrill/.git/
tb@linux:~/cyrill$ echo File>File
tb@linux:~/cyrill$ git checkout -b bränch
Switched to a new branch 'bränch'
tb@linux:~/cyrill$ git add File
tb@linux:~/cyrill$ git commit -m "Add File"
[bränch (root-commit) e39d84e] Add File
 1 file changed, 1 insertion(+)
 create mode 100644 "File"
tb@linux:~/cyrill$ git branch
* bränch
tb@linux:~/cyrill$ 

tb@macos:~> git clone tb@linux:~/cyrill
Cloning into 'cyrill'...
tb@linux's password:
remote: Counting objects: 3, done.
Receiving objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
tb@macos:~> cd cyrill/
tb@macos:~/cyrill> git branch
* bränch
tb@macos:~/cyrill> ls -l
total 8
-rw-r--r-- 1 tb staff 6 Jul 26 03:39 File
tb@macos:~/cyrill>

===================
Other question:
what does (on Mac OS)
git config core.precomposeunicode
give you?
/Torsten

#9 lore raw

26.07.2013, 05:50, "Torsten Bögershausen" <[email protected]>:

Quoted 43 lines · иванов иван
Quoted 5 lines

 hello! there is problem vith git and cyrillic (utf-8) names of branches. branch creates perfectly, but when i clone this remote branch to local host, there are 2 bugs:
 1) "git branch" doesnt show checked branch with asterisk (while on remote server it does)
 2) "git push" gives 2 errors: "fatal: BRANCH_NAME cannot be resolved to branch." and "fatal: The remote end hung up unexpectedly"
 thanks.

It could be helpful if you could provide more information. The best could be a step-by-step instruction using a some "mini repo", so that we we can reproduce the problem.
I have done an illustrating example using UTF-8,
(not cyrillic, I don't have these letters on my keyboard ;-)

tb@linux:~$ mkdir cyrill
tb@linux:~$ cd cyrill/
tb@linux:~/cyrill$ git init
Initialized empty Git repository in /home/tb/cyrill/.git/
tb@linux:~/cyrill$ echo File>File
tb@linux:~/cyrill$ git checkout -b bränch
Switched to a new branch 'bränch'
tb@linux:~/cyrill$ git add File
tb@linux:~/cyrill$ git commit -m "Add File"
[bränch (root-commit) e39d84e] Add File
 1 file changed, 1 insertion(+)
 create mode 100644 "File"
tb@linux:~/cyrill$ git branch
* bränch
tb@linux:~/cyrill$

tb@macos:~> git clone tb@linux:~/cyrill
Cloning into 'cyrill'...
tb@linux's password:
remote: Counting objects: 3, done.
Receiving objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
tb@macos:~> cd cyrill/
tb@macos:~/cyrill> git branch
* bränch
tb@macos:~/cyrill> ls -l
total 8
-rw-r--r--  1 tb  staff  6 Jul 26 03:39 File
tb@macos:~/cyrill>

Quoted 6 lines

===================
Other question:
what does (on Mac OS)
git config core.precomposeunicode
give you?
/Torsten

okay, i've changed core.precomposeunicode to true and seems it solved the problem, branches are listed just fine and git push goes good as well. i didn't look that way at first time, thought that is case for filenames only, not branches. thank you all for responces, i guess this time problem is really solved now. :)