Opened 12 years ago
Closed 11 years ago
#11198 closed defect (fixed)
test_get_historian_with_unicode_path fails
Reported by: | Christian Boos | Owned by: | Jun Omae |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | plugin/git | Version: | 1.0-stable |
Severity: | normal | Keywords: | git |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Test introduced in r11799.
On Linux, with git 1.8.1.4:
FAIL: test_get_historian_with_unicode_path (tracopt.versioncontrol.git.tests.PyGIT.UnicodeNameTestCase) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/cboos/trac/1.0-stable/tracopt/versioncontrol/git/tests/PyGIT.py", line 300, in test_get_historian_with_unicode_path historian)) AssertionError: '37628107126171a5d01d4581486d2f59011406d6' != None
On Windows with git 1.7.7.msysgit.0 that test passes, so without having looked deeper I can't tell if the problem comes from the platform or the version of git.
Attachments (0)
Change History (9)
comment:1 by , 12 years ago
comment:5 by , 11 years ago
Milestone: | next-stable-1.0.x → 1.0.2 |
---|
I just catch it! Reproduced on Ubuntu 12 and git 1.7.9.5. The issue is caused by unexpected output of git log --name-status
.
The paths of commits are quoted.
$ export LANG=en_US.UTF8 $ git --version git version 1.7.9.5 $ git init /tmp/ticket11198 Initialized empty Git repository in /tmp/ticket11198/.git/ $ cd /tmp/ticket11198 $ git config user.name Joé $ git config user.email joe@example.com $ touch .gitignore $ git add .gitignore $ git commit -a -m test [master (root-commit) cdbc5be] test 0 files changed create mode 100644 .gitignore $ touch tickét.txt $ git add tickét.txt $ git commit -a -m test [master 2e06e52] test 0 files changed create mode 100644 "tick\303\251t.txt" $ git log --pretty=format:%n%H --name-status 2e06e5274b293c15e8f43d17e2f9595459861900 A "tick\303\251t.txt" cdbc5be781c73d5ab8fe4acf7137fd03d4ff1542 A .gitignore
We expect that the paths are not quoted.
$ export LANG=en_US.UTF8 $ git --version git version 1.8.2.1 $ git init /tmp/ticket11198 Initialized empty Git repository in /tmp/ticket11198/.git/ $ cd /tmp/ticket11198 $ git config user.name Joé $ git config user.email joe@example.com $ touch .gitignore $ git add .gitignore $ git commit -a -m test [master (root-commit) d8e3cde] test 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .gitignore $ touch tickét.txt $ git add tickét.txt $ git commit -a -m test [master 1ce4589] test 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tickét.txt $ git log --pretty=format:%n%H --name-status 1ce4589d571a1ceaed88aeffc63accfb949fe97e A tickét.txt d8e3cde87d877ec0810d5c0314f10332bb83af43 A .gitignore
This is the workaround for it.
-
tracopt/versioncontrol/git/PyGIT.py
diff --git a/tracopt/versioncontrol/git/PyGIT.py b/tracopt/versioncontrol/git/PyGIT.py index e48c28f..920c9f1 100644
a b class GitCore(object): 87 87 88 88 cmd = [self.__git_bin] 89 89 if self.__git_dir: 90 cmd.append('--git-dir=%s' % self.__git_dir) 90 cmd.extend(('--git-dir=%s' % self.__git_dir, 91 '-c', 'core.quotepath=false')) 91 92 cmd.append(gitcmd) 92 93 cmd.extend(args) 93 94
comment:6 by , 11 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:8 by , 11 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Oops, some failures with git package on CentOS 6.
FAILED (failures=3, errors=4)
The -c
option is available since v1.7.2. The git package on CentOS 6 is v1.7.1….
$ cat /etc/redhat-release CentOS release 6.4 (Final) $ rpm -q git git-1.7.1-3.el6_4.1.x86_64 $ /usr/bin/git --git-dir=/tmp/trac-gitrepos-Gi0lho/.git -c core.quotepath=false rev-parse --tags Unknown option: -c usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path] [-p|--paginate|--no-pager] [--no-replace-objects] [--bare] [--git-dir=GIT_DIR] [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS]
comment:9 by , 11 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Git command quotes control characters, double quote and backslash in paths to \t
or \037
regardless of core.quotepath
setting. We should unquote the paths.
Fixed in [11999-12000].
Humm, all unit tests pass with git 1.7.1 (git-1.7.1-3.el6_4.1.x86_64) and git 1.8.1.4 (installed from source) on CentOS 6.4.