Re: git-svn: regression with funny chars in svn repo url
- From
- Eric Wong <normalperson@yhbt.net>
- Date
- Apr 7, 2008, 08:11 UTC
- Message-ID
- <20080407081108.GA28853@soma>
- In-Reply-To
- <d06901f0804011111o1da8a197ob6a9aaccb3e1e9a0@mail.gmail.com>
Panagiotis Vossos <pavossos@gmail.com> wrote:
Show 17 quoted lines
> I keep a copy of the gtk+ svn repository on my machine and I have > noticed the following bug with git-svn: > > ~/gitproj/gtk+$ which git-svn > /usr/local/bin/git-svn > > ~/gitproj/gtk+$ ls -l /usr/local/bin/git-svn > lrwxrwxrwx 1 root staff 39 2008-03-30 07:45 /usr/local/bin/git-svn -> > ../encap/git-1.5.4_20080328/bin/git-svn > > ~/gitproj/gtk+$ git-svn --version > git-svn version 1.5.4.5 (svn 1.4.6) > > ~/gitproj/gtk+$ git-svn rebase > Apache got a malformed URI: REPORT request failed on > '/svn/gtk+/!svn/vcc/default': Unusable URI: it does not refer to this > repository at /usr/local/bin/git-svn line 3821
I've known of this bug for a while but didn't track it down until now. Please let me know if this fixes things for you and if there are any regressions; thanks.
>From a9ebe54adf7ae2620fba1f638dee9566f8ccca82 Mon Sep 17 00:00:00 2001
From: Eric Wong <normalperson@yhbt.net> Date: Mon, 7 Apr 2008 00:41:44 -0700 Subject: [PATCH] git-svn: fix cloning of HTTP URLs with '+' in their path
With this, git svn clone -s http://svn.gnome.org/svn/gtk+ is successful.
Also modified the funky rename test for this, which _does_ include escaped '+' signs for HTTP URLs. SVN seems to accept either "+" or "%2B" in filenames and directories (just not the main URL), so I'll leave it alone for now.
Signed-off-by: Eric Wong <normalperson@yhbt.net> --- git-svn.perl | 2 +- t/t9115-git-svn-dcommit-funky-renames.sh | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl index 81afb5c..d91ef7a 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -3666,7 +3666,7 @@ sub escape_uri_only { my ($uri) = @_; my @tmp; foreach (split m{/}, $uri) { - s/([^\w.%-]|%(?![a-fA-F0-9]{2}))/sprintf("%%%02X",ord($1))/eg; + s/([^\w.%+-]|%(?![a-fA-F0-9]{2}))/sprintf("%%%02X",ord($1))/eg; push @tmp, $_; } join('/', @tmp); diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh index 182299c..835b1dc 100755 --- a/t/t9115-git-svn-dcommit-funky-renames.sh +++ b/t/t9115-git-svn-dcommit-funky-renames.sh @@ -49,6 +49,16 @@ test_expect_success 'rename pretty file into ugly one' ' git svn dcommit ' +test_expect_success 'add a file with plus signs' ' + echo .. > +_+ && + git update-index --add +_+ && + git commit -m plus && + mkdir gtk+ && + git mv +_+ gtk+/_+_ && + git commit -m plus_dir && + git svn dcommit + ' + stop_httpd test_done
-- Eric Wong