git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Efficient cloning from svn (with multiple branches/tags subdirs)

From
EWEric Wong <normalperson@yhbt.net>
Date
Oct 14, 2009, 06:03 UTC
Message-ID
<20091014060307.GA17178@dcvr.yhbt.net>
In-Reply-To
<hb2fvu$8qi$1@ger.gmane.org>
Bruno Harbulot <Bruno.Harbulot@manchester.ac.uk> wrote:
Show 16 quoted lines
> Hello,
>
> I'm trying to clone an existing subversion repository (Restlet:  
> http://restlet.tigris.org/source/browse/). I'm using Git 1.6.5. The  
> layout of the project is like this:
>   trunk/
>   branches/1.0
>   branches/1.1
>   tags/1.0/1.0b1
>   tags/1.0/1.0b2
>   ...
>   tags/1.0/1.0.1
>   ...
>   tags/1.1/1.1.0
>   tags/1.1/1.1.1
>   ...
Hi Bruno,

That looks like there's two levels of tags. You should be able to do this with your version of git in $GIT_CONFIG:

	[svn-remote "svn"]
		url = http://restlet.tigris.org/svn/restlet
		fetch = trunk:refs/remotes/svn/trunk
		branches = branches/*:refs/remotes/svn/*
		tags = tags/*/*:refs/remotes/svn/tags/*/*
		; note the */* to glob at multiple levels
Show 22 quoted lines
> Therefore, I've tried to use this (with and without '-T trunk', but  
> that's a separate problem):
>
>   git init
>   git svn init --prefix=svn/ -t tags/1.0 -t tags/1.1 -t tags/1.2 -t  
> tags/2.0 -b branches/1.0 -b branches/1.1  
> http://restlet.tigris.org/svn/restlet
>   git svn fetch
>
>
> This takes a while (I've had to interrupt this) and this creates a  
> number of branches such as:
>   remotes/svn/tags/1.0b1
>   remotes/svn/tags/1.0b2
>   remotes/svn/tags/1.0b3
>   remotes/svn/tags/1.0b3@1883
>   remotes/svn/tags/1.0b3@323
>
>
> What surprises me is that it looks like it's looping over and over,  
> since sometimes it starts back from SVN revision 1 when it's trying to  
> import a new tag.

Yeah, that's an unfortunate thing about the flexibility of Subversion, basically anything can be a "tag" or a directory and it's extremely hard for git svn to support any uncommon cases for tags/branches out-of-the box, so the manual config editing is needed.

-- 
Eric Wong
Previous: Bruno HarbulotNext: Bruno Harbulot
Message 2 of 9 in “Efficient cloning from svn (with multiple branches/tags subdirs)”
  1. Bruno HarbulotOct 13, 2009
  2. Eric WongOct 14, 2009
  3. Bruno HarbulotOct 14, 2009
  4. Avery PennarunOct 14, 2009
  5. Eric WongOct 14, 2009
  6. Avery PennarunOct 14, 2009
  7. Bruno HarbulotOct 15, 2009
  8. B Smith-MannschottOct 15, 2009
  9. Bruno HarbulotOct 16, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.