Subject: Re: [RFC PATCH] add t3420-rebase-topology

From: Chris Webb <[email-masked]>
Date: Thu, 27 Sep 2012 13:20:35 +0100

Martin von Zweigbergk <[email-masked]> writes:

> On Tue, Sep 18, 2012 at 12:53 AM, Johannes Sixt <[email-masked]> wrote:
>
> > Why? Is it more like "--root implies --force"?
> 
> It doesn't currently exactly imply --force, but the effect is the
> same. Also see my reply to Junio's email in this thread.
> 
> Maybe Chris has some thoughts on this?

Hi Martin and Johannes. Sorry for the slow follow-up here.

You're right that rebase --root without --onto always creates a brand new
root as a result of the implementation using a sentinel commit. Clearly this
is what's wanted with --interactive, but rebase --root with neither --onto
nor --interactive is a slightly odd combination for which I struggle to
imagine a natural use. Perhaps you're right that for consistency it should
be a no-op unless --force-rebase is given?

If we did this, this combination would be a no-op unconditionally as by
definition we're always descended from the root of our current commit.
However, given the not-very-useful behaviour, I suspect that rebase --root
is much more likely to be a mistyped version of rebase -i --root than rebase
--root --force-rebase. (Unless I'm missing a reasonable use for this?
History linearisation perhaps?)

Best wishes,

Chris.