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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 5, 2013 at 7:38 AM, John Keeping <john@xxxxxxxxxxxxx> wrote:
> On Thu, Sep 05, 2013 at 07:01:03AM -0400, John Szakmeister wrote:
[snip]
>> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]