git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Git (svn) merge - but ignore certain commits?
@ 2008-12-27 13:02 "Peter Valdemar Mørch (Lists)"
  2008-12-28  0:17 ` Peter Harris
  0 siblings, 1 reply; 6+ messages in thread
From: "Peter Valdemar Mørch (Lists)" @ 2008-12-27 13:02 UTC (permalink / raw)
  To: git

Hi,

I'm wondering how to merge a branch back to a master/svn trunk, getting 
"almost" all the commits on the branch. I've experimented with "git 
merge -s ours" unsuccessfully and don't know how else to proceed.

Background: Our svn trunk has had many solid commits, and a few that 
aren't ready yet. We need to make a new release without these unready 
commits but with some new functionality.

Externally to git, a branch was made off of trunk's HEAD. Call it 
"newbranch".

The idea is to:

* Create a git branch off of svn "newbranch", call it "gitnewbranch".

* "git revert" the "few unready" commits on "gitnewbranch" so we have a 
solid foundation

* add the new functionality to "gitnewbranch"

* "git svn dcommit" to get the new functionality on svn's "newbranch"

* And now the trick: "git merge" "gitnewbranch" back to master. But I 
want to avoid the "git revert" of the few commits that weren't ready yet.

* "git svn dcommit" master to get the new functionality into svn trunk.

How do I "git merge" all of "gitnewbranch" except the reverts?

I tried doing just the revert step, and then
"git merge -s ours gitnewbranch"
on master, and that seemed to work. Annoyingly (to me :-D) "git log 
master" does show the reverts that happened on gitnewbranch, but the 
files in master were not changed. However, when I "git svn rebase", it 
fails with a
"CONFLICT (content): Merge conflict in <file>".
And hence, "git svn dcommit" fails too.

Is there a way to "git merge gitnewbranch" excluding the reverts, just 
the "new functionality", so the log of master doesn't even mention the 
reverts and so "git svn rebase" and "git svn dcommit" work properly?

I guess I could git cherry-pick all the "new functionality" commits from 
gitnewbranch to master, but it sort of defeats the coolness of gits 
branch handling if I have to keep track of the cherry-picked commits 
manually.

How do I do this "properly"?

Peter
-- 
Peter Valdemar Mørch
http://www.morch.com

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

end of thread, other threads:[~2009-01-08 20:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-27 13:02 Git (svn) merge - but ignore certain commits? "Peter Valdemar Mørch (Lists)"
2008-12-28  0:17 ` Peter Harris
2009-01-08 17:49   ` "Peter Valdemar Mørch (Lists)"
2009-01-08 18:29     ` Peter Harris
2009-01-08 19:17       ` "Peter Valdemar Mørch (Lists)"
2009-01-08 20:00         ` Peter Harris

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