{"thread":{"id":"24625","subject":"[PATCH] git-svn: URL-decode the left-hand side of an svn refspec","startedAt":"2010-08-03T23:21:25Z","lastAt":"2010-08-05T06:40:55Z","messageCount":4,"participants":["Steven Walter","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"147080","messageId":"1280877685-4928-1-git-send-email-stevenrwalter@gmail.com","threadId":"24625","inReplyTo":null,"subject":"[PATCH] git-svn: URL-decode the left-hand side of an svn refspec","fromName":"Steven Walter","fromEmail":"stevenrwalter@gmail.com","sentAt":"2010-08-03T23:21:25Z","receivedAt":"2010-08-03T23:21:25Z","isPatch":true,"sender":{"key":"stevenrwalter@gmail.com","avatar":"https://avatars.githubusercontent.com/u/79127?v=4"},"body":"From: Steven Walter <swalter@lpdev.prtdev.lexmark.com>\n\nThis change allows git-svn to handle an URL with colons in the path\n---\n git-svn.perl |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex af70353..5d08dc6 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1812,6 +1812,8 @@ sub read_all_remotes {\n \t\t\tdie(\"svn-remote.$remote: remote ref '$remote_ref' \"\n \t\t\t    . \"must start with 'refs/'\\n\")\n \t\t\t\tunless $remote_ref =~ m{^refs/};\n+                        # local_ref is an URL, so url-decode it\n+                        $local_ref =~ s/\\%([A-Fa-f0-9]{2})/pack('C', hex($1))/seg;\n \t\t\t$r->{$remote}->{fetch}->{$local_ref} = $remote_ref;\n \t\t\t$r->{$remote}->{svm} = {} if $use_svm_props;\n \t\t} elsif (m!^(.+)\\.usesvmprops=\\s*(.*)\\s*$!) {\n-- \n1.7.0.3.gaa64d.dirty\n"},{"id":"147098","messageId":"20100804083840.GA19367@dcvr.yhbt.net","threadId":"24625","inReplyTo":"1280877685-4928-1-git-send-email-stevenrwalter@gmail.com","subject":"Re: [PATCH] git-svn: URL-decode the left-hand side of an svn refspec","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-08-04T08:38:40Z","receivedAt":"2010-08-04T08:38:40Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Steven Walter <stevenrwalter@gmail.com> wrote:\n> From: Steven Walter <swalter@lpdev.prtdev.lexmark.com>\n> \n> This change allows git-svn to handle an URL with colons in the path\n> ---\n>  git-svn.perl |    2 ++\n>  1 files changed, 2 insertions(+), 0 deletions(-)\n\nThanks Steven.\n\nSince git-svn already has a uri_decode() function, we should use that.\nThe decoding should apply to the local portion of branches/tags globs,\ntoo.  Does the following work for you?\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 8d2ef3d..34884b8 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1820,6 +1820,7 @@ sub read_all_remotes {\n \t\t\tdie(\"svn-remote.$remote: remote ref '$remote_ref' \"\n \t\t\t    . \"must start with 'refs/'\\n\")\n \t\t\t\tunless $remote_ref =~ m{^refs/};\n+\t\t\t$local_ref = uri_decode($local_ref);\n \t\t\t$r->{$remote}->{fetch}->{$local_ref} = $remote_ref;\n \t\t\t$r->{$remote}->{svm} = {} if $use_svm_props;\n \t\t} elsif (m!^(.+)\\.usesvmprops=\\s*(.*)\\s*$!) {\n@@ -1832,6 +1833,7 @@ sub read_all_remotes {\n \t\t\tdie(\"svn-remote.$remote: remote ref '$remote_ref' ($t) \"\n \t\t\t    . \"must start with 'refs/'\\n\")\n \t\t\t\tunless $remote_ref =~ m{^refs/};\n+\t\t\t$local_ref = uri_decode($local_ref);\n \t\t\tmy $rs = {\n \t\t\t    t => $t,\n \t\t\t    remote => $remote,\n-- \nEric Wong\n"},{"id":"147108","messageId":"AANLkTi=5qEhYABJv8CBxXwOY-UKkRc05bO=kKYkborKq@mail.gmail.com","threadId":"24625","inReplyTo":"20100804083840.GA19367@dcvr.yhbt.net","subject":"Re: [PATCH] git-svn: URL-decode the left-hand side of an svn refspec","fromName":"Steven Walter","fromEmail":"stevenrwalter@gmail.com","sentAt":"2010-08-04T12:37:51Z","receivedAt":"2010-08-04T12:37:51Z","isPatch":true,"sender":{"key":"stevenrwalter@gmail.com","avatar":"https://avatars.githubusercontent.com/u/79127?v=4"},"body":"On Wed, Aug 4, 2010 at 4:38 AM, Eric Wong <normalperson@yhbt.net> wrote:\n> Thanks Steven.\n>\n> Since git-svn already has a uri_decode() function, we should use that.\n> The decoding should apply to the local portion of branches/tags globs,\n> too.  Does the following work for you?\n>\n> diff --git a/git-svn.perl b/git-svn.perl\n> index 8d2ef3d..34884b8 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -1820,6 +1820,7 @@ sub read_all_remotes {\n>                        die(\"svn-remote.$remote: remote ref '$remote_ref' \"\n>                            . \"must start with 'refs/'\\n\")\n>                                unless $remote_ref =~ m{^refs/};\n> +                       $local_ref = uri_decode($local_ref);\n>                        $r->{$remote}->{fetch}->{$local_ref} = $remote_ref;\n>                        $r->{$remote}->{svm} = {} if $use_svm_props;\n>                } elsif (m!^(.+)\\.usesvmprops=\\s*(.*)\\s*$!) {\n> @@ -1832,6 +1833,7 @@ sub read_all_remotes {\n>                        die(\"svn-remote.$remote: remote ref '$remote_ref' ($t) \"\n>                            . \"must start with 'refs/'\\n\")\n>                                unless $remote_ref =~ m{^refs/};\n> +                       $local_ref = uri_decode($local_ref);\n>                        my $rs = {\n>                            t => $t,\n>                            remote => $remote,\n> --\n> Eric Wong\n>\n\nYes, this works.  Thanks!\n-- \n-Steven Walter <stevenrwalter@gmail.com>\n"},{"id":"147149","messageId":"20100805064055.GA4319@dcvr.yhbt.net","threadId":"24625","inReplyTo":"AANLkTi=5qEhYABJv8CBxXwOY-UKkRc05bO=kKYkborKq@mail.gmail.com","subject":"Re: [PATCH] git-svn: URL-decode the left-hand side of an svn refspec","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-08-05T06:40:55Z","receivedAt":"2010-08-05T06:40:55Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Steven Walter <stevenrwalter@gmail.com> wrote:\n> On Wed, Aug 4, 2010 at 4:38 AM, Eric Wong <normalperson@yhbt.net> wrote:\n> > Thanks Steven.\n> >\n> > Since git-svn already has a uri_decode() function, we should use that.\n> > The decoding should apply to the local portion of branches/tags globs,\n> > too.  Does the following work for you?\n<snip>\n> Yes, this works.  Thanks!\n\nThanks Steven, I've pushed the following out for Junio at\ngit://git.bogomips.org/git-svn\n\nFrom 46cb16fb599451f417e7cd668e77866f5aa03fc0 Mon Sep 17 00:00:00 2001\nFrom: Steven Walter <swalter@lpdev.prtdev.lexmark.com>\nDate: Tue, 3 Aug 2010 19:21:25 -0400\nSubject: [PATCH] git svn: URL-decode left-hand side of svn refspec\n\nThis change allows git-svn to handle an URL with colons in the path\n\n[ew: rewritten to use uri_decode() function]\n\nSigned-off-by: Eric Wong <normalperson@yhbt.net>\n---\n git-svn.perl |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 8d2ef3d..34884b8 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1820,6 +1820,7 @@ sub read_all_remotes {\n \t\t\tdie(\"svn-remote.$remote: remote ref '$remote_ref' \"\n \t\t\t    . \"must start with 'refs/'\\n\")\n \t\t\t\tunless $remote_ref =~ m{^refs/};\n+\t\t\t$local_ref = uri_decode($local_ref);\n \t\t\t$r->{$remote}->{fetch}->{$local_ref} = $remote_ref;\n \t\t\t$r->{$remote}->{svm} = {} if $use_svm_props;\n \t\t} elsif (m!^(.+)\\.usesvmprops=\\s*(.*)\\s*$!) {\n@@ -1832,6 +1833,7 @@ sub read_all_remotes {\n \t\t\tdie(\"svn-remote.$remote: remote ref '$remote_ref' ($t) \"\n \t\t\t    . \"must start with 'refs/'\\n\")\n \t\t\t\tunless $remote_ref =~ m{^refs/};\n+\t\t\t$local_ref = uri_decode($local_ref);\n \t\t\tmy $rs = {\n \t\t\t    t => $t,\n \t\t\t    remote => $remote,\n-- \nEric Wong\n"}]}