# Git and svn as target

4 messages from 2010-06-10 to 2010-06-14. Participants: Matthias Fechner, Peter Baumann, Avery Pennarun.
Thread: https://gitlist.dev/t/24060

## Matthias Fechner, 2010-06-10 05:45

Subject: Git and svn as target
Message-ID: <4C107BEB.6020209@fechner.net>
URL: https://gitlist.dev/e/4C107BEB.6020209%40fechner.net

```
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, 2010-06-10 06:05

Subject: Re: Git and svn as target
Message-ID: <20100610060525.GA2177@m62s10.vlinux.de>
URL: https://gitlist.dev/e/20100610060525.GA2177%40m62s10.vlinux.de
In-Reply-To: <4C107BEB.6020209@fechner.net>

```
On Thu, Jun 10, 2010 at 07:45:15AM +0200, Matthias Fechner wrote:
> 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, 2010-06-10 07:11

Subject: Re: Git and svn as target
Message-ID: <AANLkTino5sVtNEFV5_nGi9NmlhBCc0-_4NhTZwKdDzho@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTino5sVtNEFV5_nGi9NmlhBCc0-_4NhTZwKdDzho%40mail.gmail.com
In-Reply-To: <20100610060525.GA2177@m62s10.vlinux.de>

```
On Thu, Jun 10, 2010 at 2:05 AM, Peter Baumann <waste.manager@gmx.de> wrote:
> 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, 2010-06-14 16:35

Subject: Re: Git and svn as target
Message-ID: <4C165A60.2010508@fechner.net>
URL: https://gitlist.dev/e/4C165A60.2010508%40fechner.net
In-Reply-To: <AANLkTino5sVtNEFV5_nGi9NmlhBCc0-_4NhTZwKdDzho@mail.gmail.com>

```
Hi,

Am 10.06.10 09:11, schrieb Avery Pennarun:
> 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

```
