Issue 2744: Invalid characters in branch names
Status:  New
Owner: ----
Reported by Ian.Kuml...@gmail.com, Jun 27, 2014
************************************************************
***** NOTE: THIS BUG TRACKER IS FOR GERRIT CODE REVIEW *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, INTERNAL *****
***** ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.    *****
***** THOSE ISSUE BELONG IN DIFFERENT ISSUE TRACKERS!  *****
************************************************************

Affected Version: 2.8.5

What steps will reproduce the problem?
1. Have a user manage to create a branchname with invalid codes
2. Have that user push it's branch to gerrit
3. Let other users try to download that git with repo

What is the expected output? What do you see instead?

Repo fails since it expects ascii or utf8 in branch names.

Please provide any additional information below.

Doing a simple ASCII validation would simplify this for everyone and avoid issues with oddly created branches (Unicode character lookalike competitions are boring when you need to do acutal work ;))
Jul 15, 2014
Project Member #1 david.pu...@sonymobile.com
What error does repo give?

AFAIK there is no restriction in git that branch names must be ascii.

Jul 29, 2014
#2 Ian.Kuml...@gmail.com
Stacktrace found in our build logs....

2014-07-28 19:13:53.877 [INFO] [Repo] [main] Get ssh://url/git.git
2014-07-28 19:13:56.948 [INFO] [Repo] [main] Traceback (most recent call last):
2014-07-28 19:13:56.948 [INFO] [Repo] [main]   File "/local/node_root/workspace/GetSource/sourceroot/.repo/repo/main.py", line 418, in <module>
2014-07-28 19:13:56.948 [INFO] [Repo] [main]     _Main(sys.argv[1:])
2014-07-28 19:13:56.948 [INFO] [Repo] [main]   File "/local/node_root/workspace/GetSource/sourceroot/.repo/repo/main.py", line 394, in _Main
2014-07-28 19:13:56.949 [INFO] [Repo] [main]     result = repo._Run(argv) or 0
2014-07-28 19:13:56.949 [INFO] [Repo] [main]   File "/local/node_root/workspace/GetSource/sourceroot/.repo/repo/main.py", line 142, in _Run
2014-07-28 19:13:56.949 [INFO] [Repo] [main]     result = cmd.Execute(copts, cargs)
2014-07-28 19:13:56.949 [INFO] [Repo] [main]   File "/local/node_root/workspace/GetSource/sourceroot/.repo/repo/subcmds/init.py", line 369, in Execute
2014-07-28 19:13:56.949 [INFO] [Repo] [main]     self._SyncManifest(opt)
2014-07-28 19:13:56.949 [INFO] [Repo] [main]   File "/local/node_root/workspace/GetSource/sourceroot/.repo/repo/subcmds/init.py", line 211, in _SyncManifest
2014-07-28 19:13:56.949 [INFO] [Repo] [main]     if not m.Sync_NetworkHalf(is_new=is_new):
2014-07-28 19:13:56.949 [INFO] [Repo] [main]   File "/local/node_root/workspace/GetSource/sourceroot/.repo/repo/project.py", line 1031, in Sync_NetworkHalf
2014-07-28 19:13:56.950 [INFO] [Repo] [main]     no_tags=no_tags):
2014-07-28 19:13:56.950 [INFO] [Repo] [main]   File "/local/node_root/workspace/GetSource/sourceroot/.repo/repo/project.py", line 1646, in _RemoteFetch
2014-07-28 19:13:56.950 [INFO] [Repo] [main]     line = '%s %s\n' % (all_refs[r], r)
2014-07-28 19:13:56.950 [INFO] [Repo] [main] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 18: ordinal not in range(128)

This goes for tags/branches - this is one example of three that was fixed... =P