Thread (17 messages) 17 messages, 6 authors, 2016-06-15

Re: [PATCH 0/3] Reject non-ff pulls by default

From: John Szakmeister <hidden>
Date: 2016-06-15 22:58:38

On Thu, Sep 5, 2013 at 7:38 AM, John Keeping [off-list ref] wrote:
On Thu, Sep 05, 2013 at 07:01:03AM -0400, John Szakmeister wrote:
[snip]
quoted
So what I really want isn't quite rebase.  I'm not sure any of the
proposed solutions would work.  It'd be really nice to replay only the
mainline commits, without affecting commits introduced from a topic
branch.
Does "git rebase --preserve-merges" do what you want here?
No, unfortunately, it does not.  If the topic branch was not based on
the current tip of master, "git rebase --preserve-merges" will rebase
the commits of the topic branch as well.  So this:

       Q -- R -- S     (topic)
     /            \
    A -- B ------- D   (master)

Will become this after "git rebase --preserve-merges @{u}":

                 Q' -- R' -- S'    (topic')
               /              \
    A -- B -- C -------------- D'  (master)

It's unfortunate for a couple of reasons.  First, we don't want Q, R,
and S rebased--we just want the merge replayed.  Secondly, it gets
more confusing because Q, R, and S were rebased, but the topic branch
wasn't actually touched.  So topic still contains Q, R, and S, but
master now contains Q', R', and S'.  What we actually want is:

       Q -- R -- S     (topic)
     /            \
    A -- B -- C -- D'  (master)

HTH!

-John
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help