From: Peter Baumann <waste.manager@gmx.de>
To: Christopher Marshall <christopherlmarshall@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: git svn clone, a non-standard layout question
Date: Mon, 13 Aug 2012 08:31:32 +0200 [thread overview]
Message-ID: <20120813063132.GD10899@m62s10.vlinux.de> (raw)
In-Reply-To: <CANW+GuQ=egge=NcdSakChYXXZkW=MsG9f3i9yNvoutXXVFcPzQ@mail.gmail.com>
On Sun, Aug 12, 2012 at 11:23:16PM -0400, Christopher Marshall wrote:
> I would like to use git svn to clone an svn repo with a non-standard
> branches layout roughly like this:
> trunk/
> tags/
> branches/
> b1
> b2
> ...
> bdir/
> b3
> b4
> ...
>
> That is, every directory under branches is a branch except bdir, and
> every directory under bdir is a branch.
>
> One thing I have attempted is this:
> git svn clone \
> --trunk=trunk \
> --branches=branches/bdir \
> --branches=branches \
> --tags=tags \
> --prefix=svn/ $SVN_REPO \
> git.svn
>
> That properly creates the remote tracking branches b1,b2,b3,b4 but
> also creates the remote tracking branch bdir, which I am trying to
> exclude. If I were to settle for this, the bdir branch would have
> enormous trees committed to it (when I ran against the real svn repo I
> am targetting).
>
> I get can exactly the branch mapping I want by editing .git/config like this:
> [svn-remote "svn"]
> url = file:///home/chris/programs/svn/repo
> fetch = trunk:refs/remotes/svn/trunk
> tags = tags/*:refs/remotes/svn/tags/*
> branches = branches/{b1,b2}:refs/remotes/svn/*
> branches = branches/bdir/{b3,b4}:refs/remotes/svn/*
>
> but then I would have to manually add branches before every git svn
> fetch, or risk not importing new branches that other developers have
> created since I last fetched.
>
I had a similar problem, but I solved it using "ignore-paths" and "ignore-refs".
If I remember correctly, you need to set both to ignore bdir directly without
ignoring b3, b4,...
For ignore-refs, pls see cdb51a13c3cf4830d499d1138160eacdd2b8aa46, as it is currently
undocumented.
So I would try experimenting with the following settings:
[svn-remote "svn"]
url = file:///home/chris/programs/svn/repo
fetch = trunk:refs/remotes/svn/trunk
tags = tags/*:refs/remotes/svn/tags/*
branches = branches/{b1,b2}:refs/remotes/svn/*
branches = branches/bdir/{b3,b4}:refs/remotes/svn/*
# Operates on the imported git branches
ignore-refs = ^refs/remotes/bdir$
# Operates on the SVN branches; you might try it first without this statement
ignore-paths = ^branches/bdir$
next prev parent reply other threads:[~2012-08-13 6:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-13 3:23 git svn clone, a non-standard layout question Christopher Marshall
2012-08-13 6:31 ` Peter Baumann [this message]
2012-08-13 13:29 ` Christopher Marshall
2012-08-13 13:38 ` Peter Baumann
2012-08-13 17:27 ` Christopher Marshall
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=20120813063132.GD10899@m62s10.vlinux.de \
--to=waste.manager@gmx.de \
--cc=christopherlmarshall@gmail.com \
--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;
as well as URLs for NNTP newsgroup(s).