{"thread":{"id":"14767","subject":"Re: [PATCH] git-svn: Abort with an error if 'fetch' parameter is invalid.","startedAt":"2008-07-30T20:56:46Z","lastAt":"2008-08-04T00:46:18Z","messageCount":4,"participants":["Avery Pennarun","Eric Wong","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"85686","messageId":"32541b130807301356n68bf1a2an9443f1fc48f0e22c@mail.gmail.com","threadId":"14767","inReplyTo":"1217451235-9609-1-git-send-email-apenwarr@gmail.com","subject":"Re: [PATCH] git-svn: Abort with an error if 'fetch' parameter is invalid.","fromName":"Avery Pennarun","fromEmail":"apenwarr@gmail.com","sentAt":"2008-07-30T20:56:46Z","receivedAt":"2008-07-30T20:56:46Z","isPatch":true,"sender":{"key":"apenwarr@gmail.com","avatar":"https://avatars.githubusercontent.com/u/20592?v=4"},"body":"On 7/30/08, Avery Pennarun <apenwarr@stasis.open.versabanq.com> wrote:\n> ...\n\nPlease excuse the broken From: line on the above patch.  The\n@gmail.com address is correct.\n\nAvery\n"},{"id":"86129","messageId":"20080804000140.GA13019@untitled","threadId":"14767","inReplyTo":"1217451235-9609-1-git-send-email-apenwarr@gmail.com","subject":"Re: [PATCH] git-svn: Abort with an error if 'fetch' parameter is invalid.","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-08-04T00:01:40Z","receivedAt":"2008-08-04T00:01:40Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Avery Pennarun <apenwarr@stasis.open.versabanq.com> wrote:\n> Previously, if a config entry looked like this:\n> \n>          svn-remote.svn.fetch=:refs/heads/whatever\n> \n> git-svn would silently do nothing if you asked it to \"git svn fetch\", and\n> give a strange error if asked to \"git svn dcommit\".  What it really wants is\n> a line that looks like this:\n> \n> \tsvn-remote.svn.fetch=:refs/remotes/whatever\n> \n> So we should simply abort if we get the wrong thing.\n> \n> On the other hand, there's actually no good reason for git-svn to enforce\n> using the refs/remotes namespace, but the code seems to have hardcoded this\n> in several places and I'm not brave enough to try to fix it all right now.\n\nFully agreed (as I've stated in the past, too).  I just haven't had\ntime to fix it.\n\n> Signed-off-by: Avery Pennarun <apenwarr@gmail.com>\n\nThanks Avery,\nAcked-by: Eric Wong <normalperson@yhbt.net>\n\n> ---\n> \n> I just spent altogether too much time tracking down this problem when\n> migrating my git-svn settings from one repo to another.\n> \n>  git-svn.perl |    8 ++++++--\n>  1 files changed, 6 insertions(+), 2 deletions(-)\n> \n> diff --git a/git-svn.perl b/git-svn.perl\n> index cf6dbbc..cc35f50 100755\n> --- a/git-svn.perl\n> +++ b/git-svn.perl\n> @@ -1420,8 +1420,12 @@ sub read_all_remotes {\n>  \t    svn.useSvmProps/) };\n>  \t$use_svm_props = $use_svm_props eq 'true' if $use_svm_props;\n>  \tforeach (grep { s/^svn-remote\\.// } command(qw/config -l/)) {\n> -\t\tif (m!^(.+)\\.fetch=\\s*(.*)\\s*:\\s*refs/remotes/(.+)\\s*$!) {\n> -\t\t\tmy ($remote, $local_ref, $remote_ref) = ($1, $2, $3);\n> +\t\tif (m!^(.+)\\.fetch=\\s*(.*)\\s*:\\s*(.+)\\s*$!) {\n> +\t\t\tmy ($remote, $local_ref, $_remote_ref) = ($1, $2, $3);\n> +\t\t\tdie(\"svn-remote.$remote: remote ref '$_remote_ref' \"\n> +\t\t\t    . \"must start with 'refs/remotes/'\\n\")\n> +\t\t\t\tunless $_remote_ref =~ m{^refs/remotes/(.+)};\n> +\t\t\tmy $remote_ref = $1;\n>  \t\t\t$local_ref =~ s{^/}{};\n>  \t\t\t$r->{$remote}->{fetch}->{$local_ref} = $remote_ref;\n>  \t\t\t$r->{$remote}->{svm} = {} if $use_svm_props;\n> -- \n> 1.6.0.rc0.42.g186458.dirty\n> \n> \n"},{"id":"86130","messageId":"7viquh7hpq.fsf@gitster.siamese.dyndns.org","threadId":"14767","inReplyTo":"20080804000140.GA13019@untitled","subject":"Re: [PATCH] git-svn: Abort with an error if 'fetch' parameter is invalid.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-08-04T00:21:37Z","receivedAt":"2008-08-04T00:21:37Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <normalperson@yhbt.net> writes:\n\n>> Signed-off-by: Avery Pennarun <apenwarr@gmail.com>\n>\n> Thanks Avery,\n> Acked-by: Eric Wong <normalperson@yhbt.net>\n\nI do not seem to find the original message in mbox nor list archive, by\nthe way...\n"},{"id":"86133","messageId":"20080804004618.GA3182@untitled","threadId":"14767","inReplyTo":"7viquh7hpq.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] git-svn: Abort with an error if 'fetch' parameter is invalid.","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2008-08-04T00:46:18Z","receivedAt":"2008-08-04T00:46:18Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> Eric Wong <normalperson@yhbt.net> writes:\n> \n> >> Signed-off-by: Avery Pennarun <apenwarr@gmail.com>\n> >\n> > Thanks Avery,\n> > Acked-by: Eric Wong <normalperson@yhbt.net>\n> \n> I do not seem to find the original message in mbox nor list archive, by\n> the way...\n\nCould've been Avery's original From: line not being spam filter\nfriendly.\n\nHere you go (with From: line fixed)\n\n>From 574c237f4561cf0293e7f44ab604bb701d1931f3 Mon Sep 17 00:00:00 2001\nFrom: Avery Pennarun <apenwarr@gmail.com>\nDate: Wed, 30 Jul 2008 16:53:55 -0400\nSubject: [PATCH] git-svn: Abort with an error if 'fetch' parameter is invalid.\n\nPreviously, if a config entry looked like this:\n\n         svn-remote.svn.fetch=:refs/heads/whatever\n\ngit-svn would silently do nothing if you asked it to \"git svn fetch\", and\ngive a strange error if asked to \"git svn dcommit\".  What it really wants is\na line that looks like this:\n\n\tsvn-remote.svn.fetch=:refs/remotes/whatever\n\nSo we should simply abort if we get the wrong thing.\n\nOn the other hand, there's actually no good reason for git-svn to enforce\nusing the refs/remotes namespace, but the code seems to have hardcoded this\nin several places and I'm not brave enough to try to fix it all right now.\n\nSigned-off-by: Avery Pennarun <apenwarr@gmail.com>\n---\n git-svn.perl |    8 ++++++--\n 1 files changed, 6 insertions(+), 2 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex 0a346f8..1c39f45 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1423,8 +1423,12 @@ sub read_all_remotes {\n \t    svn.useSvmProps/) };\n \t$use_svm_props = $use_svm_props eq 'true' if $use_svm_props;\n \tforeach (grep { s/^svn-remote\\.// } command(qw/config -l/)) {\n-\t\tif (m!^(.+)\\.fetch=\\s*(.*)\\s*:\\s*refs/remotes/(.+)\\s*$!) {\n-\t\t\tmy ($remote, $local_ref, $remote_ref) = ($1, $2, $3);\n+\t\tif (m!^(.+)\\.fetch=\\s*(.*)\\s*:\\s*(.+)\\s*$!) {\n+\t\t\tmy ($remote, $local_ref, $_remote_ref) = ($1, $2, $3);\n+\t\t\tdie(\"svn-remote.$remote: remote ref '$_remote_ref' \"\n+\t\t\t    . \"must start with 'refs/remotes/'\\n\")\n+\t\t\t\tunless $_remote_ref =~ m{^refs/remotes/(.+)};\n+\t\t\tmy $remote_ref = $1;\n \t\t\t$local_ref =~ s{^/}{};\n \t\t\t$r->{$remote}->{fetch}->{$local_ref} = $remote_ref;\n \t\t\t$r->{$remote}->{svm} = {} if $use_svm_props;\n-- \nEric Wong\n"}]}