プロジェクト

全般

プロフィール

Vote #66994

完了

Git: Repository path encoding of non UTF-8 characters

Admin Redmine さんがほぼ2年前に追加. ほぼ2年前に更新.

ステータス:
Closed
優先度:
低め
担当者:
-
カテゴリ:
SCM_3
対象バージョン:
開始日:
2010/04/07
期日:
進捗率:

100%

予定工数:
category_id:
3
version_id:
27
issue_org_id:
5251
author_id:
14106
assigned_to_id:
11192
comments:
17
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
17
ステータス-->[Closed]

説明

If filename include Scandinavian character, Redmine convert them another character. In this case, filename TEKIJÄT replaces string "TEKIJ\303\204T".


journals

Try "git config --global core.quotepath false".
--------------------------------------------------------------------------------
If your filename encoding is not UTF-8, try #2664 patches.

--------------------------------------------------------------------------------
I'd have told you to try to set [[RedmineSettings#Repositories-encodings]] to whatever locale "scandinavian" is, but it seems it pertains only to file contents, not file names.
--------------------------------------------------------------------------------
http://www.redmine.org/issues/2664#note-4
> Mercurial (and also Git) treats file names as byte string.
> Here we need to convert them to UTF-8,
> but, there's no reliable info about file name encoding.

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
I update a patch for Git at "note-19":http://www.redmine.org/issues/2664#note-19 of #2664.
--------------------------------------------------------------------------------
Ruby 1.9 compatibility is very serious.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
It is impossible to fix this issue in current git adapter scheme.
Please see r5027 comment.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Toshi MARUYAMA wrote:
> It is impossible to fix this issue in current git adapter scheme.
> Please see r5027 comment.

<pre>
$ git cat-file commit f85f88f507577dd2fa197db9e330875b2ea0757f
tree 887f4cf35a6ed3acd3bf72843b65884d8f637029
parent 57ca437c0acbbcb749821fdf3726a1367056d364
author jsmith <jsmith@foo.bar> 1285909440 -0500
committer jsmith <jsmith@foo.bar> 1285909440 -0500

copy latin-1 file.

--HG--
rename : latin-1-dir/test-?.txt => latin-1-dir/test-?-1.txt

</pre>

<pre>
$ git cat-file commit 67e7792ce20ccae2e4bb73eed09bb397819c8834 | iconv -f ISO-8859-1 -t UTF-8
tree 1ec7b464f0331a7d597ee2461ec58b3a0af11114
parent 7234cb2750b63f47bff735edc50a1c0a433c2518
author test latin-1 ÀÈÁÉÂÊÃËÄÅÆÇ <test@example.com> 1285909200 -0500
committer test latin-1 ÀÈÁÉÂÊÃËÄÅÆÇ <test@example.com> 1285909200 -0500
encoding ISO-8859-1

latin-1 ÀÈÁÉÂÊÃËÄÅÆÇ

</pre>

Git log is binary, and f85f88f507577d log is broken.

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
r5049 broke all git tests with the git version currently used on the CI server (http://www.redmine.org/builds/index.html). The -c option was introduced in a recent git version (1.7.2). Is there any workaround for older versions?
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
Jean-Philippe Lang wrote:
> r5049 broke all git tests with the git version currently used on the CI server (http://www.redmine.org/builds/index.html). The -c option was introduced in a recent git version (1.7.2). Is there any workaround for older versions?

I fixed in r5068, r5069 and r5070.
--------------------------------------------------------------------------------
I finished implementing in r5072.

h2. Limitation

* Subversion supports URL encoding path and Redmine uses it.
Mercurial adapter helper extension wraps path with URL encoding.
Git adapter uses byte string to call "git" command.
Because Ruby uses ANSI api to fork a process on Windows,
it may have trouble in different locale on Windows.
* Git adapter uses "-c core.quotepath=false" if git version is above 1.7.2
at source:trunk/lib/redmine/scm/adapters/git_adapter.rb@5069#L342 .
If your git is older than 1.7.2, you need to set "core.quotepath=false" in "config".
* Japanese Shift_JIS and Traditional Chinese Big5 have 0x5c(backslash) problem.

!Shift_JIS.png!

--------------------------------------------------------------------------------
Toshi MARUYAMA wrote:
> * Subversion supports URL encoding path and Redmine uses it.
> Mercurial adapter helper extension wraps path with URL encoding.
> Git adapter uses byte string to call "git" command.
> Because Ruby uses ANSI api to fork a process on Windows,
> it may have trouble in different locale on Windows.

Related Ruby issue:
Bug 1771
system()/popen()/popen3() & windows & unicode is not working
http://redmine.ruby-lang.org/issues/show/1771
--------------------------------------------------------------------------------


related_issues

relates,Closed,2664,Mercurial: Repository path encoding of non UTF-8 characters
relates,Closed,3396,Git: use --encoding=UTF-8 in "git log"
duplicates,Closed,9107,Git: Redmine can't show Simplified Chinese character in filenames in git repository

Admin Redmine さんがほぼ2年前に更新

  • カテゴリSCM_3 にセット
  • 対象バージョン1.2.0_27 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0