{"thread":{"id":"41463","subject":"[PATCH v4 0/3] git-svn: svn.pathnameencoding for dcommit","startedAt":"2016-02-22T02:55:08Z","lastAt":"2016-02-22T18:00:46Z","messageCount":5,"participants":["Eric Wong","Junio C Hamano"],"isPatch":true,"patchVersion":4,"patchTotal":3},"messages":[{"id":"278820","messageId":"1456109711-26866-1-git-send-email-normalperson@yhbt.net","threadId":"41463","inReplyTo":null,"subject":"[PATCH v4 0/3] git-svn: svn.pathnameencoding for dcommit","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2016-02-22T02:55:08Z","receivedAt":"2016-02-22T02:55:08Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"The following changes since commit 0233b800c838ddda41db318ee396320b3c21a560:\n\n  Merge branch 'maint' (2016-02-17 10:14:39 -0800)\n\nare available in the git repository at:\n\n  git://bogomips.org/git-svn.git ks/svn-pathnameencoding-4\n\nfor you to fetch changes up to 1b42f45255de5844b7fe8d0c60fea74cd5b9f954:\n\n  git-svn: apply \"svn.pathnameencoding\" before URL encoding (2016-02-22 02:29:36 +0000)\n\n----------------------------------------------------------------\nEric Wong (1):\n      git-svn: hoist out utf8 prep from t9129 to lib-git-svn\n\nKazutoshi Satoda (2):\n      git-svn: enable \"svn.pathnameencoding\" on dcommit\n      git-svn: apply \"svn.pathnameencoding\" before URL encoding\n\n perl/Git/SVN/Editor.pm                   |  4 +++-\n t/lib-git-svn.sh                         | 12 ++++++++++\n t/t9115-git-svn-dcommit-funky-renames.sh | 40 ++++++++++++++++++++++++++++++--\n t/t9129-git-svn-i18n-commitencoding.sh   | 12 +---------\n 4 files changed, 54 insertions(+), 14 deletions(-)\n"},{"id":"278821","messageId":"1456109711-26866-2-git-send-email-normalperson@yhbt.net","threadId":"41463","inReplyTo":"1456109711-26866-1-git-send-email-normalperson@yhbt.net","subject":"[PATCH v4 1/3] git-svn: hoist out utf8 prep from t9129 to lib-git-svn","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2016-02-22T02:55:09Z","receivedAt":"2016-02-22T02:55:09Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"We will be reusing this in t9115.\n\nSuggested-by: Kazutoshi Satoda <k_satoda@f2.dion.ne.jp>\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n t/lib-git-svn.sh                       | 12 ++++++++++++\n t/t9129-git-svn-i18n-commitencoding.sh | 12 +-----------\n 2 files changed, 13 insertions(+), 11 deletions(-)\n\ndiff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh\nindex b0ec12f..6a50b87 100644\n--- a/t/lib-git-svn.sh\n+++ b/t/lib-git-svn.sh\n@@ -186,3 +186,15 @@ start_svnserve () {\n              --listen-host 127.0.0.1 &\n }\n \n+prepare_a_utf8_locale () {\n+\ta_utf8_locale=$(locale -a | sed -n '/\\.[uU][tT][fF]-*8$/{\n+\tp\n+\tq\n+}')\n+\tif test -n \"$a_utf8_locale\"\n+\tthen\n+\t\ttest_set_prereq UTF8\n+\telse\n+\t\tsay \"# UTF-8 locale not available, some tests are skipped\"\n+\tfi\n+}\ndiff --git a/t/t9129-git-svn-i18n-commitencoding.sh b/t/t9129-git-svn-i18n-commitencoding.sh\nindex 39b6bcb..8dbd647 100755\n--- a/t/t9129-git-svn-i18n-commitencoding.sh\n+++ b/t/t9129-git-svn-i18n-commitencoding.sh\n@@ -14,17 +14,7 @@ compare_git_head_with () {\n \ttest_cmp current \"$1\"\n }\n \n-a_utf8_locale=$(locale -a | sed -n '/\\.[uU][tT][fF]-*8$/{\n-\tp\n-\tq\n-}')\n-\n-if test -n \"$a_utf8_locale\"\n-then\n-\ttest_set_prereq UTF8\n-else\n-\tsay \"# UTF-8 locale not available, some tests are skipped\"\n-fi\n+prepare_a_utf8_locale\n \n compare_svn_head_with () {\n \t# extract just the log message and strip out committer info.\n-- \nEW\n"},{"id":"278823","messageId":"1456109711-26866-3-git-send-email-normalperson@yhbt.net","threadId":"41463","inReplyTo":"1456109711-26866-1-git-send-email-normalperson@yhbt.net","subject":"[PATCH v4 2/3] git-svn: enable \"svn.pathnameencoding\" on dcommit","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2016-02-22T02:55:10Z","receivedAt":"2016-02-22T02:55:10Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"From: Kazutoshi Satoda <k_satoda@f2.dion.ne.jp>\n\nWithout the initialization of $self->{pathnameencoding}, conversion in\nrepo_path() is always skipped as $self->{pathnameencoding} is undefined\neven if \"svn.pathnameencoding\" is configured.\n\nThe lack of conversion results in mysterious failure of dcommit (e.g.\n\"Malformed XML\") which happen only when a commit involves a change on\nnon-ASCII path.\n\n[ew: add test case to t9115,\n squash LC_ALL=$a_utf8_locale export from Kazutoshi for Cygwin]\n\nSigned-off-by: Kazutoshi SATODA <k_satoda@f2.dion.ne.jp>\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n perl/Git/SVN/Editor.pm                   |  1 +\n t/t9115-git-svn-dcommit-funky-renames.sh | 25 +++++++++++++++++++++++--\n 2 files changed, 24 insertions(+), 2 deletions(-)\n\ndiff --git a/perl/Git/SVN/Editor.pm b/perl/Git/SVN/Editor.pm\nindex c50176e..d9d9bdf 100644\n--- a/perl/Git/SVN/Editor.pm\n+++ b/perl/Git/SVN/Editor.pm\n@@ -41,6 +41,7 @@ sub new {\n \t                       \"$self->{svn_path}/\" : '';\n \t$self->{config} = $opts->{config};\n \t$self->{mergeinfo} = $opts->{mergeinfo};\n+\t$self->{pathnameencoding} = Git::config('svn.pathnameencoding');\n \treturn $self;\n }\n \ndiff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\nindex 6a48e40..a3927c4 100755\n--- a/t/t9115-git-svn-dcommit-funky-renames.sh\n+++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n@@ -77,11 +77,32 @@ test_expect_success 'make a commit to test rebase' '\n \t'\n \n test_expect_success 'git svn rebase works inside a fresh-cloned repository' '\n-\tcd test-rebase &&\n+\t(\n+\t\tcd test-rebase &&\n \t\tgit svn rebase &&\n \t\ttest -e test-rebase-main &&\n \t\ttest -e test-rebase\n-\t'\n+\t)'\n+\n+# Without this, LC_ALL=C as set in test-lib.sh, and Cygwin converts\n+# non-ASCII characters in filenames unexpectedly, and causes errors.\n+# https://cygwin.com/cygwin-ug-net/using-specialnames.html#pathnames-specialchars\n+# > Some characters are disallowed in filenames on Windows filesystems. ...\n+# ...\n+# > ... All of the above characters, except for the backslash, are converted\n+# > to special UNICODE characters in the range 0xf000 to 0xf0ff (the\n+# > \"Private use area\") when creating or accessing files.\n+prepare_a_utf8_locale\n+test_expect_success UTF8 'svn.pathnameencoding=cp932 new file on dcommit' '\n+\tLC_ALL=$a_utf8_locale &&\n+\texport LC_ALL &&\n+\tneq=$(printf \"\\201\\202\") &&\n+\tgit config svn.pathnameencoding cp932 &&\n+\techo neq >\"$neq\" &&\n+\tgit add \"$neq\" &&\n+\tgit commit -m \"neq\" &&\n+\tgit svn dcommit\n+'\n \n stop_httpd\n \n-- \nEW\n"},{"id":"278822","messageId":"1456109711-26866-4-git-send-email-normalperson@yhbt.net","threadId":"41463","inReplyTo":"1456109711-26866-1-git-send-email-normalperson@yhbt.net","subject":"[PATCH v4 3/3] git-svn: apply \"svn.pathnameencoding\" before URL encoding","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2016-02-22T02:55:11Z","receivedAt":"2016-02-22T02:55:11Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"From: Kazutoshi Satoda <k_satoda@f2.dion.ne.jp>\n\nThe conversion from \"svn.pathnameencoding\" to UTF-8 should be applied\nfirst, and then URL encoding should be applied on the resulting UTF-8\npath. The reversed order of these transforms (used before this fix)\nmakes non-UTF-8 URL which causes error from Subversion such as\n\"Filesystem has no item: '...' path not found\" when sending a rename (or\na copy) from non-ASCII path.\n\n[ew: t9115 test case added (requires SVN_HTTPD_PORT set to test),\n squash LC_ALL=$a_utf8_locale export from Kazutoshi for Cygwin]\n\nSigned-off-by: Kazutoshi SATODA <k_satoda@f2.dion.ne.jp>\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n perl/Git/SVN/Editor.pm                   |  3 ++-\n t/t9115-git-svn-dcommit-funky-renames.sh | 15 +++++++++++++++\n 2 files changed, 17 insertions(+), 1 deletion(-)\n\ndiff --git a/perl/Git/SVN/Editor.pm b/perl/Git/SVN/Editor.pm\nindex d9d9bdf..4c4199a 100644\n--- a/perl/Git/SVN/Editor.pm\n+++ b/perl/Git/SVN/Editor.pm\n@@ -144,11 +144,12 @@ sub repo_path {\n \n sub url_path {\n \tmy ($self, $path) = @_;\n+\t$path = $self->repo_path($path);\n \tif ($self->{url} =~ m#^https?://#) {\n \t\t# characters are taken from subversion/libsvn_subr/path.c\n \t\t$path =~ s#([^~a-zA-Z0-9_./!$&'()*+,-])#sprintf(\"%%%02X\",ord($1))#eg;\n \t}\n-\t$self->{url} . '/' . $self->repo_path($path);\n+\t$self->{url} . '/' . $path;\n }\n \n sub rmdirs {\ndiff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh\nindex a3927c4..0990f8d 100755\n--- a/t/t9115-git-svn-dcommit-funky-renames.sh\n+++ b/t/t9115-git-svn-dcommit-funky-renames.sh\n@@ -104,6 +104,21 @@ test_expect_success UTF8 'svn.pathnameencoding=cp932 new file on dcommit' '\n \tgit svn dcommit\n '\n \n+# See the comment on the above test for setting of LC_ALL.\n+test_expect_success 'svn.pathnameencoding=cp932 rename on dcommit' '\n+\tLC_ALL=$a_utf8_locale &&\n+\texport LC_ALL &&\n+\tinf=$(printf \"\\201\\207\") &&\n+\tgit config svn.pathnameencoding cp932 &&\n+\techo inf >\"$inf\" &&\n+\tgit add \"$inf\" &&\n+\tgit commit -m \"inf\" &&\n+\tgit svn dcommit &&\n+\tgit mv \"$inf\" inf &&\n+\tgit commit -m \"inf rename\" &&\n+\tgit svn dcommit\n+'\n+\n stop_httpd\n \n test_done\n-- \nEW\n"},{"id":"278889","messageId":"xmqqr3g47hgx.fsf@gitster.mtv.corp.google.com","threadId":"41463","inReplyTo":"1456109711-26866-1-git-send-email-normalperson@yhbt.net","subject":"Re: [PATCH v4 0/3] git-svn: svn.pathnameencoding for dcommit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-02-22T18:00:46Z","receivedAt":"2016-02-22T18:00:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n> The following changes since commit 0233b800c838ddda41db318ee396320b3c21a560:\n>\n>   Merge branch 'maint' (2016-02-17 10:14:39 -0800)\n>\n> are available in the git repository at:\n>\n>   git://bogomips.org/git-svn.git ks/svn-pathnameencoding-4\n>\n> for you to fetch changes up to 1b42f45255de5844b7fe8d0c60fea74cd5b9f954:\n>\n>   git-svn: apply \"svn.pathnameencoding\" before URL encoding (2016-02-22 02:29:36 +0000)\n\nThanks.\n"}]}