From: "\"Peter Valdemar Mørch (Lists)\"" <4ux6as402@sneakemail.com>
To: git@vger.kernel.org
Subject: Git (svn) merge - but ignore certain commits?
Date: Sat, 27 Dec 2008 14:02:01 +0100	[thread overview]
Message-ID: <49562749.9060705@sneakemail.com> (raw)
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
next             reply	other threads:[~2008-12-27 13:06 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-27 13:02 "Peter Valdemar Mørch (Lists)" [this message]
2008-12-28  0:17 ` Git (svn) merge - but ignore certain commits? 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=49562749.9060705@sneakemail.com \
    --to=4ux6as402@sneakemail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
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).