Edgewall Software
Modify

Opened 7 years ago

Closed 7 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 Jun Omae, 7 years ago

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.

comment:2 by Christian Boos, 7 years ago

Ok, I'll have to dig deeper then. Thanks for the rapid feedback!

comment:3 by Christian Boos, 7 years ago

Ryan also reported this problem in ticket:11180#comment:3.

comment:4 by anonymous, 7 years ago

I just experienced this issue - any leads?

comment:5 by Jun Omae, 7 years ago

Milestone: next-stable-1.0.x1.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):  
    8787
    8888        cmd = [self.__git_bin]
    8989        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'))
    9192        cmd.append(gitcmd)
    9293        cmd.extend(args)
    9394
Last edited 7 years ago by Jun Omae (previous) (diff)

comment:6 by Jun Omae, 7 years ago

Owner: set to Jun Omae
Status: newassigned

comment:7 by Jun Omae, 7 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [11835].

comment:8 by Jun Omae, 7 years ago

Resolution: fixed
Status: closedreopened

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 Jun Omae, 7 years ago

Resolution: fixed
Status: reopenedclosed

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].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.