From: Michael J Gruber <git@drmicha.warpmail.net>
To: Marc Branchaud <marcnarc@xiplink.com>
Cc: git list <git@vger.kernel.org>, normalperson@yhbt.net
Subject: Re: git svn: Supporting multiple branch subdirs?
Date: Wed, 17 Jun 2009 16:25:50 +0200 [thread overview]
Message-ID: <4A38FCEE.2020002@drmicha.warpmail.net> (raw)
In-Reply-To: <4A368509.9070801@xiplink.com>
Marc Branchaud venit, vidit, dixit 15.06.2009 19:29:
> Michael J Gruber wrote:
>>
>> After doing the init with "--branches=stable" (without releng), do
>> git config --add svn-remote.svn.branches 'releng/*:refs/remotes/*'
>>
>> This gives you two branches refspecs in .git/config (feel free to put
>> them in different dirs under remotes if there may be name clashes
>> between stable and releng branches).
>
> That doesn't seem to work...
No, it doesn't I'm sorry. I knew that git-svn lumps multiple command
line arguments into one, but it does so also for config lines. I didn't
know that but confirmed from a test (and the source).
Now, one last resort would be a more complicated regexp. Unfortunately,
something like
branches = (releng|stable)/*:refs/remotes/*/*
does not work (regexps don't work, only globs)
and something like
branches = */*:refs/remotes/*/*
works in principle but gets everything under head wrong.
>
> Here's my .git/config file before the first fetch:
>
> [svn-remote "svn"]
> useSvnsyncProps = 1
> ignore-paths = ^[^/]+/(?:cvs2svn|projects|svnadmin|user|vendor.*)
> url = file:///home/marcnarc/Code/FreeBSD-all-mirror/base
> fetch = head:refs/remotes/trunk
> branches = stable/*:refs/remotes/stable/*
> branches = releng/*:refs/remotes/releng/*
> tags = release/*:refs/remotes/tags/*
>
> (Shouldn't that fetch line be head:refs/remots/head, since there's nothing called "trunk" in the svn repo? I used git-svn init --trunk=head ...)
The left hand side of the refspec refers to the svn repo, the right hand
side only names your local ref. Feel free to put "head" there, although
this can be confused very easily with "HEAD" which has special meaning
in git.
>> I assume that git-svn converts such an svn commit into several git
>> commits, one for each affected branch. Since you have a local mirror
>> it's easy to try out.
>
> Yep, git-svn does just that. Nice!
>
> M.
At least I got one thing right :)
I've used multiple svn-remote sections before (in cases where the repo
structure changed) but I'm afraid this is of no use here. Looking at the
source of git-svn, one sees that "tags" and "branches" are basically
treated the same way, they are simply members of a "remote"
struct/object/whatever it's called in perl and only differ in their
standard refspec. Noone keeps us from adding "branches2" for a quick
hack and checking whether everything stays sane... (git-svn perl often
loops over "branches tags", that needs to be replaced).
In fact, I think the way to go would be replacing the two by an array.
As a next step, the command line parsing and config reading needs to be
changed so that multiple branches or tags entries end up generating
multiple members of that array. Now this only needs to be implemented ;)
Michael
P.S.: Let me know if you give it a shot, so that we don't duplicate our
waste of time...
next prev parent reply other threads:[~2009-06-17 14:26 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-12 21:46 git svn: Supporting multiple branch subdirs? Marc Branchaud
2009-06-13 11:46 ` Michael J Gruber
2009-06-15 17:29 ` Marc Branchaud
2009-06-17 14:25 ` Michael J Gruber [this message]
2009-06-17 15:25 ` Marc Branchaud
2009-06-18 14:03 ` Michael J Gruber
2009-06-18 14:28 ` Marc Branchaud
2009-06-18 16:00 ` Michael J Gruber
2009-06-18 14:31 ` [MONKEY PATCH] git-svn: allow two branch configurations Michael J Gruber
2009-06-22 14:50 ` Marc Branchaud
2009-06-23 17:02 ` [PATCH] git svn: Support multiple branch and tag paths in the svn repository Marc Branchaud
2009-06-25 9:36 ` Eric Wong
2009-06-25 22:25 ` Junio C Hamano
2009-06-26 0:33 ` Eric Wong
2009-06-26 5:18 ` Andreas Ericsson
2009-06-26 18:11 ` Eric Wong
2009-06-26 19:20 ` Marc Branchaud
2009-06-26 20:49 ` [PATCH] git svn: Doc update for multiple branch and tag paths Marc Branchaud
2009-06-26 20:57 ` [PATCH] git svn: Support multiple branch and tag paths in the svn repository Eric Wong
2009-06-26 21:08 ` [PATCH] git svn: Fix t9138-multiple-branches to use svn_cmd and (cd ...) syntax Marc Branchaud
2009-06-26 21:54 ` Eric Wong
2009-06-27 15:03 ` Marc Branchaud
2009-06-27 22:08 ` Eric Wong
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=4A38FCEE.2020002@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=marcnarc@xiplink.com \
--cc=normalperson@yhbt.net \
/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).