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

Re: [PATCH] git-svn: URL-decode the left-hand side of an svn refspec

From
EWEric Wong <normalperson@yhbt.net>
Date
Aug 5, 2010, 06:40 UTC
Message-ID
<20100805064055.GA4319@dcvr.yhbt.net>
In-Reply-To
<AANLkTi=5qEhYABJv8CBxXwOY-UKkRc05bO=kKYkborKq@mail.gmail.com>
Steven Walter <stevenrwalter@gmail.com> wrote:
Show 6 quoted lines
> On Wed, Aug 4, 2010 at 4:38 AM, Eric Wong <normalperson@yhbt.net> wrote:
> > Thanks Steven.
> >
> > Since git-svn already has a uri_decode() function, we should use that.
> > The decoding should apply to the local portion of branches/tags globs,
> > too.  Does the following work for you?
<snip>
> Yes, this works.  Thanks!

Thanks Steven, I've pushed the following out for Junio at git://git.bogomips.org/git-svn

From 46cb16fb599451f417e7cd668e77866f5aa03fc0 Mon Sep 17 00:00:00 2001
From: Steven Walter <swalter@lpdev.prtdev.lexmark.com>
Date: Tue, 3 Aug 2010 19:21:25 -0400
Subject: [PATCH] git svn: URL-decode left-hand side of svn refspec
This change allows git-svn to handle an URL with colons in the path
[ew: rewritten to use uri_decode() function]
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-svn.perl |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 8d2ef3d..34884b8 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1820,6 +1820,7 @@ sub read_all_remotes {
 			die("svn-remote.$remote: remote ref '$remote_ref' "
 			    . "must start with 'refs/'\n")
 				unless $remote_ref =~ m{^refs/};
+			$local_ref = uri_decode($local_ref);
 			$r->{$remote}->{fetch}->{$local_ref} = $remote_ref;
 			$r->{$remote}->{svm} = {} if $use_svm_props;
 		} elsif (m!^(.+)\.usesvmprops=\s*(.*)\s*$!) {
@@ -1832,6 +1833,7 @@ sub read_all_remotes {
 			die("svn-remote.$remote: remote ref '$remote_ref' ($t) "
 			    . "must start with 'refs/'\n")
 				unless $remote_ref =~ m{^refs/};
+			$local_ref = uri_decode($local_ref);
 			my $rs = {
 			    t => $t,
 			    remote => $remote,
-- 
Eric Wong
Previous: Steven Walter
Message 4 of 4 in “git-svn: URL-decode the left-hand side of an svn refspec”
  1. git-svn: URL-decode the left-hand side of an svn refspecSteven Walter, Aug 3, 2010
  2. Eric WongAug 4, 2010
  3. Steven WalterAug 4, 2010
  4. Eric WongAug 5, 2010

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.