Skip to contentSkip to conversation

git svn clone -s was not prefixing 'branches/'

PATCH Eric Wong 3 participants 4 messages Jun 15, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Eric Wong

author
#1 lore raw
Quoted 4 lines · Jonathan Lim

All branches in the subversion repository would appear at the same level as trunk. The should now appear with a 'branches/' prefix.

This is too ugly for the common existing cases. For the rare case where this could lead to a namespace conflict[1], it's possible to work around it by editing .git/config.

I would accept a --tags-prefix= and --branches-prefix= patch to make this possible w/o having to edit .git/config, but I don't want the default prefixes changed.

Thanks,

[1] - "/branches/trunk" vs "/trunk", which I've yet to see evidence of...

Quoted 16 lines
---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-svn.perl +1 -1
index ad01e18..17d65cb 100755
@@ -789,7 +789,7 @@ sub cmd_multi_init {
 	}
 	return unless defined $_branches || defined $_tags;
 	my $ra = $url ? Git::SVN::Ra->new($url) : undef;
-	complete_url_ls_init($ra, $_branches, '--branches/-b', $_prefix);
+	complete_url_ls_init($ra, $_branches, '--branches/-b', $_prefix . 'branches/');
 	complete_url_ls_init($ra, $_tags, '--tags/-t', $_prefix . 'tags/');
 }
#2 lore raw

Hi,

Maybe this patch doesn't fix the problem I was having. I will attempt to describe it better here.

I understand that a standard subversion setup is as follows:
trunk
branches
tags

With the -s option, svn clone should expect this.

Using the example subversion repository:
trunk
branches/RB_1.0
branches/RB_2.0
tags/REL_1.0
tags/REL_2.0

Currently, using the -s option you get:
trunk
RB_1.0
RB_2.0
tags/REL_1.0
tags/REL_2.0

I think it makes sense to have:
trunk
branches/RB_1.0
branches/RB_2.0
tags/REL_1.0
tags/REL_2.0

Regards,
Jon

Quoted 35 lines · Eric Wong
Quoted 4 lines · Jonathan Lim

All branches in the subversion repository would appear at the same level as trunk. The should now appear with a 'branches/' prefix.

This is too ugly for the common existing cases. For the rare case where this could lead to a namespace conflict[1], it's possible to work around it by editing .git/config.

I would accept a --tags-prefix= and --branches-prefix= patch to make this possible w/o having to edit .git/config, but I don't want the default prefixes changed.

Thanks,

[1] - "/branches/trunk" vs "/trunk", which I've yet to see evidence of...

Quoted 16 lines
---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-svn.perl +1 -1
index ad01e18..17d65cb 100755
@@ -789,7 +789,7 @@ sub cmd_multi_init {
      }
      return unless defined $_branches || defined $_tags;
      my $ra = $url ? Git::SVN::Ra->new($url) : undef;
-     complete_url_ls_init($ra, $_branches, '--branches/-b', $_prefix);
+     complete_url_ls_init($ra, $_branches, '--branches/-b', $_prefix . 'branches/');
      complete_url_ls_init($ra, $_tags, '--tags/-t', $_prefix . 'tags/');
 }
Signature · 1 line
http://snowblink.co.uk/
#3 lore raw
Quoted 26 lines · Jon Lim

Hi,

Maybe this patch doesn't fix the problem I was having. I will attempt to describe it better here.

I understand that a standard subversion setup is as follows:
trunk
branches
tags

With the -s option, svn clone should expect this.

Using the example subversion repository:
trunk
branches/RB_1.0
branches/RB_2.0
tags/REL_1.0
tags/REL_2.0

Currently, using the -s option you get:
trunk
RB_1.0
RB_2.0
tags/REL_1.0
tags/REL_2.0

Quoted 6 lines

I think it makes sense to have:
trunk
branches/RB_1.0
branches/RB_2.0
tags/REL_1.0
tags/REL_2.0

Why? "trunk" is just a branch like any other branch, too. It's basically just a svn convention that it's not in branches/ but in its own "toplevel" directory. Once imported into git, it's just an ordinary remote tracking branch. It's already pretty well distiguishable from all the other branches due to its name.

What _does_ make sense is to have a common prefix for all the stuff you got from svn, using for example --prefix=svn/. That way you get:
svn/trunk
svn/RB_1.0
svn/RB_2.0
svn/tags/REL_1.0
svn/tags/REL_2.0

The important part is that those names aren't ambiguous if you have local branch heads called, for example:
trunk
RB_1.0
RB_2.0

as the svn/ prefix is part of the shortname for the remote tracking branches. So "trunk" is the branch head and "svn/trunk" is the remote tracking branch.

Btw Eric, is there any reason why there's no prefix used by default? Using the name for the svn-remote as the prefix would make a lot of sense to me.

Björn

author
#4 lore raw
Quoted 34 lines · Björn Steinbrink
Quoted 26 lines · Jon Lim

Hi,

Maybe this patch doesn't fix the problem I was having. I will attempt to describe it better here.

I understand that a standard subversion setup is as follows:
trunk
branches
tags

With the -s option, svn clone should expect this.

Using the example subversion repository:
trunk
branches/RB_1.0
branches/RB_2.0
tags/REL_1.0
tags/REL_2.0

Currently, using the -s option you get:
trunk
RB_1.0
RB_2.0
tags/REL_1.0
tags/REL_2.0

Quoted 6 lines

I think it makes sense to have:
trunk
branches/RB_1.0
branches/RB_2.0
tags/REL_1.0
tags/REL_2.0

Quoted 5 lines

Why? "trunk" is just a branch like any other branch, too. It's basically just a svn convention that it's not in branches/ but in its own "toplevel" directory. Once imported into git, it's just an ordinary remote tracking branch. It's already pretty well distiguishable from all the other branches due to its name.

Yup, you said it better than I could myself :)

Quoted 14 lines

What _does_ make sense is to have a common prefix for all the stuff you got from svn, using for example --prefix=svn/. That way you get:
svn/trunk
svn/RB_1.0
svn/RB_2.0
svn/tags/REL_1.0
svn/tags/REL_2.0

The important part is that those names aren't ambiguous if you have local branch heads called, for example:
trunk
RB_1.0
RB_2.0

Quoted 7 lines

as the svn/ prefix is part of the shortname for the remote tracking branches. So "trunk" is the branch head and "svn/trunk" is the remote tracking branch.

Btw Eric, is there any reason why there's no prefix used by default? Using the name for the svn-remote as the prefix would make a lot of sense to me.

Backwards compatibility; and that I've been lazy :)

But I do agree that prefixing "svn/" is preferred for tracking new repos. I seem to recall that git-svn was actually the first user of the "remotes/" namespace before it was adopted by the rest of git, and with SVN, I didn't anticipate more than one remote.

Signature · 1 line
Eric Wong