threads / discuss / 24060

Git and svn as target

Subject: Git and svn as target

## tl;dr

4 messages between Jun 10, 2010 and Jun 14, 2010.

replies: 3people: 3as markdown or json

Matthias Fechner· Jun 10, 2010, 05:45 UTC · lore
Hi,

i started now to work with git instead of svn. The main repository is a svn repo so i use git svn ...

But I have the problem now, commit comments are not transfered to svn, maybe I miss here a parameter.

What i did: git svn fetch git svn rebase git branch test git checkout test several commits git checkout master git svn fetch git svn rebase git merge test git svn dcommit

In the commit of svn I see only merged test... Could I say git to put all the commit comments into the merge?

Gruss, Matthias

-- 
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook
Peter Baumann· Jun 10, 2010, 06:05 UTC · re: Matthias Fechner · lore

Re: Git and svn as target

On Thu, Jun 10, 2010 at 07:45:15AM +0200, Matthias Fechner wrote:
Show 23 quoted lines
> Hi,
> 
> i started now to work with git instead of svn. The main repository
> is a svn repo so i use git svn ...
> 
> But I have the problem now, commit comments are not transfered to
> svn, maybe I miss here a parameter.
> 
> What i did:
> git svn fetch
> git svn rebase
> git branch test
> git checkout test
> several commits
> git checkout master
> git svn fetch
> git svn rebase
> git merge test
> git svn dcommit
> 
> In the commit of svn I see only merged test...
> Could I say git to put all the commit comments into the merge?
> 

AFAIK git svn doesn't handle git merges very well. If you rebase your test branch onto master and then do the git-svn dcommit, everything should work as expected.

-Peter
Avery Pennarun· Jun 10, 2010, 07:11 UTC · re: Peter Baumann · lore

Re: Git and svn as target

On Thu, Jun 10, 2010 at 2:05 AM, Peter Baumann <waste.manager@gmx.de> wrote:
Show 6 quoted lines
> On Thu, Jun 10, 2010 at 07:45:15AM +0200, Matthias Fechner wrote:
>> In the commit of svn I see only merged test...
>> Could I say git to put all the commit comments into the merge?
>
> AFAIK git svn doesn't handle git merges very well. If you rebase your test branch onto
> master and then do the git-svn dcommit, everything should work as expected.

Right. I actually like it that way much more than I like rebasing onto master, but that's a matter of opinion, of course. Another option would be to simply do "git svn dcommit" from the 'test' branch rather than merging it into master first. (This essentially asks git-svn to do your rebasing for you, so it's roughly the same thing as merge-rebase-dcommit.)

You might like to look at the option "merge.log" in "man git-config". This summarizes your commit messages into the merge commit's commit message, sort of like how svn itself does it. Then you still only have one merge commit - like you do in svn - but it has a useful commit message.

Have fun,
Avery
Matthias Fechner· Jun 14, 2010, 16:35 UTC · re: Avery Pennarun · lore

Re: Git and svn as target

Hi,
Am 10.06.10 09:11, schrieb Avery Pennarun:
Show 7 quoted lines
> Right. I actually like it that way much more than I like rebasing
> onto master, but that's a matter of opinion, of course.  Another
> option would be to simply do "git svn dcommit" from the 'test' branch
> rather than merging it into master first.  (This essentially asks
> git-svn to do your rebasing for you, so it's roughly the same thing as
> merge-rebase-dcommit.)
>    

thanks, I got it working with the following sequence: git svn fetch git svn rebase git branch test git checkout test several commit with commit messages git checkout master git svn fetch git svn rebase git rebase --interactive --preserve-merges test git svn dcommit

Now I can see all local git commit as commits to the svn repository.

Bye, Matthias

-- 
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook

← back to recent threads