git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PULL] svn pathnameencoding for git svn dcommit

From
EWEric Wong <normalperson@yhbt.net>
Date
Feb 16, 2016, 06:33 UTC
Message-ID
<20160216063357.GA17455@dcvr.yhbt.net>
In-Reply-To
<56C297A9.2080705@f2.dion.ne.jp>

Junio, sorry about basing on next, I somehow thought I was going to need to depend on something there. Updated pull below if Kazutoshi can run the test effectively.

Kazutoshi Satoda <k_satoda@f2.dion.ne.jp> wrote:
Show 5 quoted lines
> Thank you for the tests. But, on my environment, both of them failed
> unexpectedly. (Windows 7 SP1, x86_64 Cygwin, LANG=ja_JP.UTF-8)
> 
> For now, I don't have enough time to investigate this further. Let me
> just share the result.
<snip>
Show 5 quoted lines
> > Untracked files:
> >         svnrepo/
> >         "\357\202\201\357\202\202"
> >         "\357\202\201\357\202\207"
> >
<snip>
> I can't see how "\357\202\201\357\202\202" came as output in the test.

I wonder if it's a shell or printf portability problem. I've repushed the branch against master and implemented the weird character use inside Perl scripts.

Can you give it a try?
The following changes since commit 494398473714dcbedb38b1ac79b531c7384b3bc4:
  Sixth batch for the 2.8 cycle (2016-02-10 14:24:14 -0800)
are available in the git repository at:
  git://bogomips.org/git-svn.git ks/svn-pathnameencoding
for you to fetch changes up to 7d7ea44ea5a1a38ee36402e6709e64c05650ba46:
  git-svn: apply "svn.pathnameencoding" before URL encoding (2016-02-16 06:25:01 +0000)
----------------------------------------------------------------
Kazutoshi Satoda (2):
      git-svn: enable "svn.pathnameencoding" on dcommit
      git-svn: apply "svn.pathnameencoding" before URL encoding
 perl/Git/SVN/Editor.pm                   |  4 +++-
 t/t9115-git-svn-dcommit-funky-renames.sh | 16 ++++++++++++++--
 t/t9115/inf.perl                         | 12 ++++++++++++
 t/t9115/neq.perl                         |  5 +++++
 4 files changed, 34 insertions(+), 3 deletions(-)
 create mode 100644 t/t9115/inf.perl
 create mode 100644 t/t9115/neq.perl
 t/t9115-git-svn-dcommit-funky-renames.sh | 16 +++-------------
 t/t9115/inf.perl                         | 12 ++++++++++++
 t/t9115/neq.perl                         |  5 +++++
 3 files changed, 20 insertions(+), 13 deletions(-)
Interdiff of test changes:
diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh
index 9828f05..94698fe 100755
--- a/t/t9115-git-svn-dcommit-funky-renames.sh
+++ b/t/t9115-git-svn-dcommit-funky-renames.sh
@@ -84,25 +84,15 @@ test_expect_success 'git svn rebase works inside a fresh-cloned repository' '
 		test -e test-rebase
 	)'
 
-test_expect_success 'svn.pathnameencoding=cp932 new file on dcommit' '
-	neq=$(printf "\201\202") &&
+test_expect_success PERL 'svn.pathnameencoding=cp932 new file on dcommit' '
 	git config svn.pathnameencoding cp932 &&
-	echo neq >"$neq" &&
-	git add "$neq" &&
+	"$PERL_PATH" -w "$TEST_DIRECTORY"/t9115/neq.perl &&
 	git commit -m "neq" &&
 	git svn dcommit
 '
 
 test_expect_success 'svn.pathnameencoding=cp932 rename on dcommit' '
-	inf=$(printf "\201\207") &&
-	git config svn.pathnameencoding cp932 &&
-	echo inf >"$inf" &&
-	git add "$inf" &&
-	git commit -m "inf" &&
-	git svn dcommit &&
-	git mv "$inf" inf &&
-	git commit -m "inf rename" &&
-	git svn dcommit
+	"$PERL_PATH" -w "$TEST_DIRECTORY"/t9115/inf.perl
 '
 
 stop_httpd
diff --git a/t/t9115/inf.perl b/t/t9115/inf.perl
new file mode 100644
index 0000000..0adcfc7
--- /dev/null
+++ b/t/t9115/inf.perl
@@ -0,0 +1,12 @@
+use strict;
+my $path = "\201\207";
+open my $fh, '>', $path or die $!;
+close $fh or die $!;
+sub run { system(@_) == 0 or die join(' ', @_) . ": $?" }
+run(qw(git config svn.pathnameencoding cp932));
+run(qw(git add), $path);
+run(qw(git commit -m inf));
+run(qw(git svn dcommit));
+run(qw(git mv), $path, 'inf');
+run(qw(git commit -m inf-rename));
+run(qw(git svn dcommit));
diff --git a/t/t9115/neq.perl b/t/t9115/neq.perl
new file mode 100644
index 0000000..91b1061
--- /dev/null
+++ b/t/t9115/neq.perl
@@ -0,0 +1,5 @@
+use strict;
+my $path = "\201\202";
+open my $fh, '>', $path or die $!;
+close $fh or die $!;
+exec(qw(git add), $path);
Previous: Kazutoshi SatodaNext: Kazutoshi Satoda
Message 10 of 25 in “enable "svn.pathnameencoding" on dcommit”
  1. 0/2 enable "svn.pathnameencoding" on dcommitKazutoshi Satoda, Feb 8, 2016
  2. 1/2 git-svn: enable "svn.pathnameencoding" on dcommitKazutoshi Satoda, Feb 8, 2016
  3. Eric WongFeb 15, 2016
  4. 2/2 git-svn: apply "svn.pathnameencoding" before URL encodingKazutoshi Satoda, Feb 8, 2016
  5. Eric WongFeb 15, 2016
  6. Eric WongFeb 8, 2016
  7. [PULL] svn pathnameencoding for git svn dcommitEric Wong, Feb 15, 2016
  8. Junio C HamanoFeb 15, 2016
  9. Kazutoshi SatodaFeb 16, 2016
  10. Eric WongFeb 16, 2016
  11. Kazutoshi SatodaFeb 16, 2016
  12. Eric WongFeb 20, 2016
  13. Kazutoshi SatodaFeb 21, 2016
  14. 1/1 t9115: Skip pathnameencoding=cp932 under HFStboegi@web.de, Feb 27, 2016
  15. Eric WongFeb 28, 2016
  16. Torsten BögershausenFeb 28, 2016
  17. Eric WongMar 15, 2016
  18. Torsten BögershausenMar 15, 2016
  19. Eric WongMar 15, 2016
  20. Kazutoshi SatodaMar 16, 2016
  21. Torsten BögershausenMar 17, 2016
  22. Torsten BögershausenMar 17, 2016
  23. Kazutoshi SatodaMar 18, 2016
  24. Torsten BögershausenMar 19, 2016
  25. Kazutoshi SatodaMar 18, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.