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

Re: [PATCH 2/2] git-svn: apply "svn.pathnameencoding" before URL encoding

From
EWEric Wong <normalperson@yhbt.net>
Date
Feb 15, 2016, 00:33 UTC
Message-ID
<20160215003331.GA19436@dcvr.yhbt.net>
In-Reply-To
<56B8B25E.9000001@f2.dion.ne.jp>
Kazutoshi Satoda <k_satoda@f2.dion.ne.jp> wrote:
Show 8 quoted lines
> The conversion from "svn.pathnameencoding" to UTF-8 should be applied
> first, and then URL encoding should be applied on the resulting UTF-8
> path. The reversed order of these transforms (used before this fix)
> makes non-UTF-8 URL which causes error from Subversion such as
> "Filesystem has no item: '...' path not found" when sending a rename (or
> a copy) from non-ASCII path.
> 
> Signed-off-by: Kazutoshi SATODA <k_satoda@f2.dion.ne.jp>
Thanks, running full SVN tests now.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Show 14 quoted lines
> --- a/perl/Git/SVN/Editor.pm
> +++ b/perl/Git/SVN/Editor.pm
> @@ -144,11 +144,12 @@ sub repo_path {
>  
>  sub url_path {
>  	my ($self, $path) = @_;
> +	$path = $self->repo_path($path);
>  	if ($self->{url} =~ m#^https?://#) {
>  		# characters are taken from subversion/libsvn_subr/path.c
>  		$path =~ s#([^~a-zA-Z0-9_./!$&'()*+,-])#sprintf("%%%02X",ord($1))#eg;
>  	}
> -	$self->{url} . '/' . $self->repo_path($path);
> +	$self->{url} . '/' . $path;
>  }

This is trickier to test, as it requires an https?:// URL. It always succeeds with the default file:// URL.

diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh
index 82222fd..9828f05 100755
--- a/t/t9115-git-svn-dcommit-funky-renames.sh
+++ b/t/t9115-git-svn-dcommit-funky-renames.sh
@@ -93,6 +93,18 @@ test_expect_success 'svn.pathnameencoding=cp932 new file on dcommit' '
 	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
+'
+
 stop_httpd
 
 test_done
-- 
EW
Previous: Kazutoshi SatodaNext: Eric Wong
Message 5 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.