Re: git-svn: how to connect SVN branches?
- From
Sam Vilain <sam@vilain.net>
- Date
- Jan 17, 2008, 22:04 UTC
- Message-ID
- <478FD0E5.2080006@vilain.net>
- In-Reply-To
- <alpine.LNX.0.999999.0801171237110.3479@mojave>
dherring@ll.mit.edu wrote:
Show 14 quoted lines
> Hi, > > The project I'm tracking changed servers a couple months ago. To simulate > the svn-switch, I edited the svn-remote.url to the new location. `git-svn > fetch`, `git-svn dcommit`, and the like seemed to work ok. > > When a new release branch came out, I tried adding > svn-remote.branches = releases/*:refs/remotes/svn/* > > `git-svn fetch` pulled the new branch. However, it created a whole new > history for this branch (new git commits from the beginning of the SVN > repo). > > Is there some way to tell git/git-svn to connect these two histories?
git-svn doesn't yet support arbitrary mapping of paths like that. You need to add a separate git-svn remote, and you might have to graft to get it started - see below.
> Pictorially, I have > > SVN1@a---SVN2@a---SVN3@b---SVN4@b---SVNtrunk > SVN1@b---SVN2@b---SVN3@b---SVN4@b---SVNbranch
That's unfortunate. There are many things that git-svn does to try to avoid this happening. You can fix it using the .git/info/grafts facility - check the Documentation/ for information on that. Once you've got it looking right, git filter-branch can be used to make it permanent, though you should certainly delete the git-svn metadata after using that.
> Similarly, if someone cloned a git repo full of git-svn-id's (which > indicate that an svn --switch occurred) but without any matching git-svn > data, is there a way to `git-svn fetch` from the new SVN repo and > autoconnect the git commits?
You basically have to fool git-svn by making commits in the history which have the git-svn-ids that you want. This can be done without changing the "real" history as above, using grafts.
Good luck, Sam.