git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem importing from SVN repository with branches/tags at multiple levels using git-svn
@ 2014-01-15 20:10 Robert Hancock
  2014-01-22 19:03 ` Robert Hancock
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Hancock @ 2014-01-15 20:10 UTC (permalink / raw)
  To: git

We have an SVN repository that has a structure for tags (likewise for
branches) like this:

tags/tag1
tags/tag2
tags/tag3/
tags/subdir/tag4
tags/subdir/tag5

The idea is that I want to have git-svn import everything inside subdir
as tags and everything else inside the root tags directory as tags, so I
end up with tag1-tag5 in Git. I've got tags= entries like this in the
Git configuration to try to achieve this:

tags = tags/subdir/*:refs/remotes/tags/*
tags = tags/*:refs/remotes/tags/*

My expectation was that everything inside subdir would match the first
line first and everything else would match the second line, so
everything would work out OK. Unfortunately it seems like for the tags
inside subdir, it's matching the second line and therefore trying to
import everything in there as directories inside one tag called subdir.
Changing the order of those lines doesn't seem to help either, it seems
determined to try to match to tags/* regardless of what order the lines
are in.

Clearly it would have been better if the repository had not been
structured this way. However, rearranging it now won't help since the
paths are like this in the SVN repository history.

The only solution I've found that kind of works is to use
tags/{tag1,tag2,tag3} instead of tags/*. Unfortunately there are a ton
of tags in that directory and adding in a giant list of tags there seems
to slow down the import process a great deal. Also, there are
potentially still tags being created in that root directory, so I would
have to keep regenerating and updating this list in the Git
configuration every time one was added. So this is not a good solution.
It would be much easier if I could get a wildcard solution to work here.

Any thoughts?

-- 
Robert Hancock
System Analyst
SED Systems
Email: hancock@sedsystems.ca

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Problem importing from SVN repository with branches/tags at multiple levels using git-svn
  2014-01-15 20:10 Problem importing from SVN repository with branches/tags at multiple levels using git-svn Robert Hancock
@ 2014-01-22 19:03 ` Robert Hancock
  2014-01-22 21:11   ` Jim Garrison
  0 siblings, 1 reply; 3+ messages in thread
From: Robert Hancock @ 2014-01-22 19:03 UTC (permalink / raw)
  To: git

On 01/15/2014 02:10 PM, Robert Hancock wrote:
> We have an SVN repository that has a structure for tags (likewise for
> branches) like this:
> 
> tags/tag1
> tags/tag2
> tags/tag3/
> tags/subdir/tag4
> tags/subdir/tag5
> 
> The idea is that I want to have git-svn import everything inside subdir
> as tags and everything else inside the root tags directory as tags, so I
> end up with tag1-tag5 in Git. I've got tags= entries like this in the
> Git configuration to try to achieve this:
> 
> tags = tags/subdir/*:refs/remotes/tags/*
> tags = tags/*:refs/remotes/tags/*
> 
> My expectation was that everything inside subdir would match the first
> line first and everything else would match the second line, so
> everything would work out OK. Unfortunately it seems like for the tags
> inside subdir, it's matching the second line and therefore trying to
> import everything in there as directories inside one tag called subdir.
> Changing the order of those lines doesn't seem to help either, it seems
> determined to try to match to tags/* regardless of what order the lines
> are in.
> 
> Clearly it would have been better if the repository had not been
> structured this way. However, rearranging it now won't help since the
> paths are like this in the SVN repository history.
> 
> The only solution I've found that kind of works is to use
> tags/{tag1,tag2,tag3} instead of tags/*. Unfortunately there are a ton
> of tags in that directory and adding in a giant list of tags there seems
> to slow down the import process a great deal. Also, there are
> potentially still tags being created in that root directory, so I would
> have to keep regenerating and updating this list in the Git
> configuration every time one was added. So this is not a good solution.
> It would be much easier if I could get a wildcard solution to work here.
> 
> Any thoughts?

Just to respond to my own question, it appears that the ignore-refs
configuration option allows one to deal with this situation. In this
case one would add something like:

ignore-refs = refs/remotes/tags/subdir$

to prevent git-svn from trying to create a Git ref called subdir.

Unfortunately there seems to be no documentation at all about this
option other than in the source commit which introduced it, unlike all
the other settings for git-svn - that seems like a bit of an oversight..

-- 
Robert Hancock
System Analyst
SED Systems
Email: hancock@sedsystems.ca

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: Problem importing from SVN repository with branches/tags at multiple levels using git-svn
  2014-01-22 19:03 ` Robert Hancock
@ 2014-01-22 21:11   ` Jim Garrison
  0 siblings, 0 replies; 3+ messages in thread
From: Jim Garrison @ 2014-01-22 21:11 UTC (permalink / raw)
  To: Robert Hancock, git@vger.kernel.org

> -----Original Message-----
> Behalf Of Robert Hancock
> Sent: Wednesday, January 22, 2014 11:03 AM
> Subject: Re: Problem importing from SVN repository with branches/tags at
> multiple levels using git-svn
> 
> On 01/15/2014 02:10 PM, Robert Hancock wrote:
> > We have an SVN repository that has a structure for tags (likewise for
> > branches) like this:
> >
> > tags/tag1
> > tags/tag2
> > tags/tag3/
> > tags/subdir/tag4
> > tags/subdir/tag5
> >
[snip]

We did this recently and decided there is only one way to do it reliably.

Copy all the tags, within subversion itself, into the structure expected by git, then use git svn following the procedures outlined in the manual.

Copying tags is cheap in subversion, and you can always delete them afterwards if you want.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-22 21:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15 20:10 Problem importing from SVN repository with branches/tags at multiple levels using git-svn Robert Hancock
2014-01-22 19:03 ` Robert Hancock
2014-01-22 21:11   ` Jim Garrison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).