* git-svn: how to connect SVN branches?
@ 2008-01-17 20:17 dherring
2008-01-17 22:04 ` Sam Vilain
2008-01-17 23:42 ` Gregory Jefferis
0 siblings, 2 replies; 4+ messages in thread
From: dherring @ 2008-01-17 20:17 UTC (permalink / raw)
To: git
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?
Pictorially, I have
SVN1@a---SVN2@a---SVN3@b---SVN4@b---SVNtrunk
SVN1@b---SVN2@b---SVN3@b---SVN4@b---SVNbranch
and want
SVN1@a---SVN2@a---SVN3@b---SVN4@b---SVNtrunk
\--SVNbranch
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?
Thanks,
Daniel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git-svn: how to connect SVN branches?
2008-01-17 20:17 git-svn: how to connect SVN branches? dherring
@ 2008-01-17 22:04 ` Sam Vilain
2008-01-18 14:43 ` dherring
2008-01-17 23:42 ` Gregory Jefferis
1 sibling, 1 reply; 4+ messages in thread
From: Sam Vilain @ 2008-01-17 22:04 UTC (permalink / raw)
To: dherring; +Cc: git
dherring@ll.mit.edu wrote:
> 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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git-svn: how to connect SVN branches?
2008-01-17 20:17 git-svn: how to connect SVN branches? dherring
2008-01-17 22:04 ` Sam Vilain
@ 2008-01-17 23:42 ` Gregory Jefferis
1 sibling, 0 replies; 4+ messages in thread
From: Gregory Jefferis @ 2008-01-17 23:42 UTC (permalink / raw)
To: dherring, git
Re connecting the two svn histories, there are some similarities to a
situation that I had. See:
Statement of problem:
http://permalink.gmane.org/gmane.comp.version-control.git/69486
Eventual solution:
http://thread.gmane.org/gmane.comp.version-control.git/69486
Nicely formatted code snippet:
http://pastie.textmate.org/private/pv1n1nbmcmtxnxbq4zd7w
Best,
Greg.
On 17/1/08 20:17, "dherring@ll.mit.edu" <dherring@ll.mit.edu> wrote:
> 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?
>
> Pictorially, I have
>
> SVN1@a---SVN2@a---SVN3@b---SVN4@b---SVNtrunk
> SVN1@b---SVN2@b---SVN3@b---SVN4@b---SVNbranch
>
> and want
>
> SVN1@a---SVN2@a---SVN3@b---SVN4@b---SVNtrunk
> \--SVNbranch
>
> 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?
>
> Thanks,
> Daniel
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: git-svn: how to connect SVN branches?
2008-01-17 22:04 ` Sam Vilain
@ 2008-01-18 14:43 ` dherring
0 siblings, 0 replies; 4+ messages in thread
From: dherring @ 2008-01-18 14:43 UTC (permalink / raw)
To: git@vger.kernel.org
Sam, Gregory, thanks for solving my problem.
On Thu, 17 Jan 2008, Sam Vilain wrote:
> dherring@ll.mit.edu wrote:
>> `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.
Documentation/repository-layout.txt had the best info on grafts. A few
graft lines and my git repo looks just right. For now, I'm scared of
breaking git-svn again; filter-branch can wait for later.
Thanks again,
Daniel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-01-18 14:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-17 20:17 git-svn: how to connect SVN branches? dherring
2008-01-17 22:04 ` Sam Vilain
2008-01-18 14:43 ` dherring
2008-01-17 23:42 ` Gregory Jefferis
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).