Skip to contentSkip to conversation

Git and svn as target

DISCUSSION Matthias Fechner 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

Signature · 1 line
"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
#1 lore raw
Quoted 20 lines · Matthias Fechner

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

Quoted 3 lines

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

#2 lore raw
Quoted 6 lines · Peter Baumann
Quoted 2 lines · Matthias Fechner

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

#3 lore raw

Hi,

Am 10.06.10 09:11, schrieb Avery Pennarun:

Quoted 7 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

Signature · 1 line
"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