Git development
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Guido Ostkamp <git@ostkamp.fastmail.fm>
Cc: git@vger.kernel.org
Subject: Re: git-svn with multiple branch directories
Date: Fri, 20 Mar 2009 03:04:11 -0700	[thread overview]
Message-ID: <20090320100411.GB17287@dcvr.yhbt.net> (raw)
In-Reply-To: <alpine.LSU.2.01.0903200002390.29898@bianca.dialin.t-online.de>

Guido Ostkamp <git@ostkamp.fastmail.fm> wrote:
> Hello,
>
> I am trying to create a git repo that tracks an SVN repo with multiple  
> branch directories.
>
> Is there any way to get this done easily?
>
> It seems the 'git svn' command allows only to specify one 'trunk',  
> 'branches' and 'tag' directory.
>
> The example usecase is the OpenOffice.org repo (it's just a private  
> experiment). I got this svn-sync'ed within 4 evening sessions, the SVN  
> size is about ~8 GB with ~270000 commits. Unfortunately their structure 
> is
>
>   branches/
>   contrib/
>   cws/
>   dist/
>   patches/
>   tags/
>   trunk/
>
> where 'cws' and 'branches' both hold branches.
>
> I have seen a web-based article telling one should
>
>   git svn clone <URL>/trunk repo.git
>
> first, and then hack the repo.git/.git/config file manually to add 
> entries like
>
>   [svn-remote "b1"]
>         url = $SVN_REPO_URL/branches/b1
>         fetch = :refs/remotes/b1
>   [svn-remote "b2"]
>         url = $SVN_REPO_URL/branches/b2
>         fetch = :refs/remotes/b2
>   [svn-remote "c1"]
>         url = $SVN_REPO_URL/cws/c1
>         fetch = :refs/remotes/c1
>   ...
>
> to later use
>
>   git svn fetch <branchname>
>
> for each branch. But even if that worked, their seems to be no easy way 
> to detect newly created branches etc. Additionally, I get two entries 
> listed in 'git branch' for each, one of which with extension '@1' (seems 
> to point ot the branch point). This doesn't seem to be the case for 
> repo's with only one branch directory converted the normal way.
>
> Any ideas?


You should be able to do something like this:

[svn-remote "svn"]
	url = $SVN_REPO_URL
	branches = branches/*:refs/remotes/branches/*
	tags = tags/*:refs/remotes/tags/*
	fetch = cws/c1:refs/remotes/cws/c1
	fetch = cws/c2:refs/remotes/cws/c2
	fetch = cws/c3:refs/remotes/cws/c3
	...

As for generating the individual fetch lines, I would just pipe
svn ls $SVN_REPO_URL/cws to awk/sed/perl...

-- 
Eric Wong (who just realized he programs in ASP :x)

      reply	other threads:[~2009-03-20 10:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-19 23:17 git-svn with multiple branch directories Guido Ostkamp
2009-03-20 10:04 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090320100411.GB17287@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=git@ostkamp.fastmail.fm \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox