Re: [PATCH 0/3] Reject non-ff pulls by default
- From
John Szakmeister <john@szakmeister.net>
- Date
- Sep 5, 2013, 12:37 UTC
- Message-ID
- <CAEBDL5U2Y-dxtGyDTW+C-SseSpuF40BNMW3oZDnfzRx8KxG7fA@mail.gmail.com>
- In-Reply-To
- <20130905113822.GF2582@serenity.lan>
On Thu, Sep 5, 2013 at 7:38 AM, John Keeping <john@keeping.me.uk> wrote:
> On Thu, Sep 05, 2013 at 07:01:03AM -0400, John Szakmeister wrote:
[snip]
Show 6 quoted lines
>> 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