From: Daniel Cordero <hidden> Date: 2016-06-15 22:47:35
Hello,
when trying to clone a svn repo with the command-line:
$ git svn clone -b / http://svn.collab.net/repos/svn/
(that is, each folder in the root of the repo should be considered it's
own branch)
the clone sometimes[1] fails saying:
ref: 'refs/remotes/' ends with a trailing slash, this is not permitted by git nor Subversion
The offending config is:
[svn-remote "svn"]
url = http://svn.collab.net/repos/svn
branches = /*:refs/remotes/*
This used to work in the past; I bisected the bad commit to
commit 6f5748e14cc5bb0a836b649fb8e2d6a5eb166f1d
Author: Adam Brewster [off-list ref]
Date: Tue Aug 11 23:14:03 2009 -0400
svn: allow branches outside of refs/remotes
Thanks in advance.
[1] It does work when the URL has at least 1 folder of depth
(e.g. suffix "trunk" to the above URL).
Its config section is:
[svn-remote "svn"]
url = http://svn.collab.net/repos/svn
branches = trunk//*:refs/remotes/*
From: Eric Wong <hidden> Date: 2016-06-15 22:47:36
Daniel Cordero [off-list ref] wrote:
Hello,
when trying to clone a svn repo with the command-line:
$ git svn clone -b / http://svn.collab.net/repos/svn/
(that is, each folder in the root of the repo should be considered it's
own branch)
the clone sometimes[1] fails saying:
ref: 'refs/remotes/' ends with a trailing slash, this is not permitted by git nor Subversion
The offending config is:
[svn-remote "svn"]
url = http://svn.collab.net/repos/svn
branches = /*:refs/remotes/*
This used to work in the past; I bisected the bad commit to
commit 6f5748e14cc5bb0a836b649fb8e2d6a5eb166f1d
Author: Adam Brewster [off-list ref]
Date: Tue Aug 11 23:14:03 2009 -0400
svn: allow branches outside of refs/remotes
Thanks in advance.
Thanks for bisecting it for us!
Reverting the left hand side of these two regexps from Adam's commit
seems to fix the problem.
@@ -1765,7 +1765,7 @@ sub read_all_remotes {my$use_svm_props=eval{command_oneline(qw/config--boolsvn.useSvmProps/)};$use_svm_props=$use_svm_propseq'true'if$use_svm_props;-my$svn_refspec=qr{\s*/?(.*?)\s*:\s*(.+?)\s*};+my$svn_refspec=qr{\s*(.*?)\s*:\s*(.+?)\s*};foreach(grep{s/^svn-remote\.//}command(qw/config -l/)){if(m!^(.+)\.fetch=$svn_refspec$!){my($remote,$local_ref,$remote_ref)=($1,$2,$3);
@@ -1979,7 +1979,7 @@ sub find_ref {my($ref_id)=@_;foreach(command(qw/config -l/)){nextunlessm!^svn-remote\.(.+)\.fetch=-\s*/?(.*?)\s*:\s*(.+?)\s*$!x;+\s*(.*?)\s*:\s*(.+?)\s*$!x;my($repo_id,$path,$ref)=($1,$2,$3);if($refeq$ref_id){$path=''if($path=~m#^\./?#);---
I'm not sure why Adam decided the leading slash needed to be removed for
the git refspec. That said, the globbing/branching code still makes me
want to hide under a rock and I'm generally afraid to touch it.
I'll wait for Adam to chime in since he's braver than I am :)
--
Eric Wong
From: Eric Wong <hidden> Date: 2016-06-15 22:47:36
From 3abaf9fdf216fd0307bb9e9f03772bd80a64177c Mon Sep 17 00:00:00 2001
From: Adam Brewster <redacted>
Date: Thu, 22 Oct 2009 21:26:32 -0700
Subject: [PATCH] git svn: fix fetch where glob is on the top-level URL
In cases where the top-level URL we're tracking is the path we
glob against, we can once again track odd repositories that keep
branches/tags at the top level. This regression was introduced
in commit 6f5748e14cc5bb0a836b649fb8e2d6a5eb166f1d.
Additionally, the leading slash is now optional when tracking
the top-level path to be consistent with non-top-level paths.
We now allow both of the following "branches" in [svn-remote
"foo"] sections of $GIT_CONFIG:
; with a leading slash (this worked before 6f5748e1)
branches = /*:refs/remotes/*
; now it it also works without a leading slash
branches = *:refs/remotes/*
Thanks to Daniel Cordero for the original bug report and
bisection.
[ew: commit message]
Signed-off-by: Eric Wong <redacted>
---
Daniel Cordero [off-list ref] wrote:
> Hello,
>
> when trying to clone a svn repo with the command-line:
>
> $ git svn clone -b / http://svn.collab.net/repos/svn/
>
> (that is, each folder in the root of the repo should be considered it's
> own branch)
> the clone sometimes[1] fails saying:
>
> ref: 'refs/remotes/' ends with a trailing slash, this is not permitted by git nor Subversion
>
> The offending config is:
> [svn-remote "svn"]
> url = http://svn.collab.net/repos/svn
> branches = /*:refs/remotes/*
>
>
> This used to work in the past; I bisected the bad commit to
>
> commit 6f5748e14cc5bb0a836b649fb8e2d6a5eb166f1d
> Author: Adam Brewster [off-list ref]
> Date: Tue Aug 11 23:14:03 2009 -0400
>
> svn: allow branches outside of refs/remotes
>
>
> Thanks in advance.
>
>
> [1] It does work when the URL has at least 1 folder of depth
> (e.g. suffix "trunk" to the above URL).
>
> Its config section is:
> [svn-remote "svn"]
> url = http://svn.collab.net/repos/svn
> branches = trunk//*:refs/remotes/*
>
git-svn.perl | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
From: Eric Wong <hidden> Date: 2016-06-15 22:47:36
Eric Wong [off-list ref] wrote:
From 3abaf9fdf216fd0307bb9e9f03772bd80a64177c Mon Sep 17 00:00:00 2001
From: Adam Brewster <redacted>
Date: Thu, 22 Oct 2009 21:26:32 -0700
Subject: [PATCH] git svn: fix fetch where glob is on the top-level URL
Actually, no, something is broken here it seems... Ugh, falling asleep :x
--
Eric Wong
From: Eric Wong <hidden> Date: 2016-06-15 22:47:36
Eric Wong [off-list ref] wrote:
Eric Wong [off-list ref] wrote:
quoted
From 3abaf9fdf216fd0307bb9e9f03772bd80a64177c Mon Sep 17 00:00:00 2001
From: Adam Brewster <redacted>
Date: Thu, 22 Oct 2009 21:26:32 -0700
Subject: [PATCH] git svn: fix fetch where glob is on the top-level URL
Actually, no, something is broken here it seems... Ugh, falling asleep :x
Oops, I was running the tests from the wrong machine that didn't have
the patch on that one.
As noted in my previous email, the leading slashes cause
SVN::Ra::get_log to fail with an assertion if the path passed to it
has a leading slash but is not a standalone slash.
Here's my original patch which seems to work fine (but doesn't allow the
more flexible, bare "*" in "branches = *:refs/remotes/*" Adam's one did.
From 42079a567bef745996b6272ad546d682dfcf57d6 Mon Sep 17 00:00:00 2001
From: Eric Wong <redacted>
Date: Thu, 22 Oct 2009 23:39:04 -0700
Subject: [PATCH] git svn: fix fetch where glob is on the top-level URL
In cases where the top-level URL we're tracking is the path we
glob against, we can once again track odd repositories that keep
branches/tags at the top level. This regression was introduced
in commit 6f5748e14cc5bb0a836b649fb8e2d6a5eb166f1d.
Thanks to Daniel Cordero for the original bug report and
bisection.
Signed-off-by: Eric Wong <redacted>
---
git-svn.perl | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)