git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-svn, merging et al.
@ 2008-05-16 15:50 Nigel Magnay
  2008-05-16 17:40 ` Kevin Ballard
  0 siblings, 1 reply; 3+ messages in thread
From: Nigel Magnay @ 2008-05-16 15:50 UTC (permalink / raw)
  To: git

Ok - it's Friday and I've got to interact with svn again..

I'm using git-svn, and I've not followed the guidance. Development has
gone on in git branches and merges - but now I need to commit the
changes back into svn, and dcommit is, understandably, not very happy.

I'm intending to instead do something like a
  git format-patch svn-branch..git-branch
  git checkout svn-branch
... apply all the patches ...
  git commit
  git svn dcommit
  # back to the git work
  git checkout git-branch
  # this shouldn't have to do merging - but it will have the parents
to make it clear where the last merge happened from ?
  git merge svn-branch


I'm happy that I'm bludgeoning changes in one big blob into SVN, as I
can reasonably say 'if you want the real details, go look at gitweb)

I've tried doing this with
 git checkout svn-branch
 git merge --squash git-branch

But I don't get the result I'm expecting - what have I missed?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git-svn, merging et al.
  2008-05-16 15:50 git-svn, merging et al Nigel Magnay
@ 2008-05-16 17:40 ` Kevin Ballard
  2008-05-19  9:14   ` Nigel Magnay
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Ballard @ 2008-05-16 17:40 UTC (permalink / raw)
  To: Nigel Magnay; +Cc: git

On May 16, 2008, at 11:50 AM, Nigel Magnay wrote:

> Ok - it's Friday and I've got to interact with svn again..
>
> I'm using git-svn, and I've not followed the guidance. Development has
> gone on in git branches and merges - but now I need to commit the
> changes back into svn, and dcommit is, understandably, not very happy.
>
> I'm intending to instead do something like a
>  git format-patch svn-branch..git-branch
>  git checkout svn-branch
> ... apply all the patches ...
>  git commit
>  git svn dcommit
>  # back to the git work
>  git checkout git-branch
>  # this shouldn't have to do merging - but it will have the parents
> to make it clear where the last merge happened from ?
>  git merge svn-branch
>
>
> I'm happy that I'm bludgeoning changes in one big blob into SVN, as I
> can reasonably say 'if you want the real details, go look at gitweb)
>
> I've tried doing this with
> git checkout svn-branch
> git merge --squash git-branch
>
> But I don't get the result I'm expecting - what have I missed?

That merge command will produce a single commit, which isn't what you  
want. format-patch + am should work to linearize history, but you  
could also use rebase.

I recommend trying something like

   git checkout -b test svn-branch && git format-patch svn-branch..git- 
branch | git am

Then you can examine your test branch to make sure it's linear, make  
sure it compiles and looks good, then if it's good merge that into svn- 
branch (which will be a fast-forward).

-Kevin Ballard

-- 
Kevin Ballard
http://kevin.sb.org
kevin@sb.org
http://www.tildesoft.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git-svn, merging et al.
  2008-05-16 17:40 ` Kevin Ballard
@ 2008-05-19  9:14   ` Nigel Magnay
  0 siblings, 0 replies; 3+ messages in thread
From: Nigel Magnay @ 2008-05-19  9:14 UTC (permalink / raw)
  To: git

Ah - useful - I'll tag that for next time.

I ended up doing a git merge --squash in the end. FWIW, it didn't work
correctly initially, until I worked out that some files were getting
munged by core.autocrlf confusing it. Once I turned it off, it was
fine.


On Fri, May 16, 2008 at 6:40 PM, Kevin Ballard <kevin@sb.org> wrote:
> On May 16, 2008, at 11:50 AM, Nigel Magnay wrote:
>
>> Ok - it's Friday and I've got to interact with svn again..
>>
>> I'm using git-svn, and I've not followed the guidance. Development has
>> gone on in git branches and merges - but now I need to commit the
>> changes back into svn, and dcommit is, understandably, not very happy.
>>
>> I'm intending to instead do something like a
>>  git format-patch svn-branch..git-branch
>>  git checkout svn-branch
>> ... apply all the patches ...
>>  git commit
>>  git svn dcommit
>>  # back to the git work
>>  git checkout git-branch
>>  # this shouldn't have to do merging - but it will have the parents
>> to make it clear where the last merge happened from ?
>>  git merge svn-branch
>>
>>
>> I'm happy that I'm bludgeoning changes in one big blob into SVN, as I
>> can reasonably say 'if you want the real details, go look at gitweb)
>>
>> I've tried doing this with
>> git checkout svn-branch
>> git merge --squash git-branch
>>
>> But I don't get the result I'm expecting - what have I missed?
>
> That merge command will produce a single commit, which isn't what you want.
> format-patch + am should work to linearize history, but you could also use
> rebase.
>
> I recommend trying something like
>
>  git checkout -b test svn-branch && git format-patch svn-branch..git-branch
> | git am
>
> Then you can examine your test branch to make sure it's linear, make sure it
> compiles and looks good, then if it's good merge that into svn-branch (which
> will be a fast-forward).
>
> -Kevin Ballard
>
> --
> Kevin Ballard
> http://kevin.sb.org
> kevin@sb.org
> http://www.tildesoft.com
>
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-05-19  9:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-16 15:50 git-svn, merging et al Nigel Magnay
2008-05-16 17:40 ` Kevin Ballard
2008-05-19  9:14   ` Nigel Magnay

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).