On Mon, Mar 07, 2022 at 05:56:22PM +0100, Johannes Schindelin wrote:
Problem statement: in the middle of an interactive rebase, the user
would like to choose a different rebase target, without having to abort
the rebase.
it didn't even occur to me to actually change the base (note that my
script has no --onto option, even though it wouldn't be that hard to
do). that stems from that fact that i have *really* rarely
(intentionally) made an interactive rebase without (the equivalent of)
--keep-base.
for me, it's about noticing that i need to rewrite some earlier commits
again before going forward.
The idea here is to generate a todo list (just like a fresh `git rebase
-i --onto <commit> <base-commit>` would have done) and _prepend_ it to
the current todo list.
yeah, that's essentially what the script does.
To support a nested `git rebase --abort`, we would probably want to insert
some marker after the newly-generated todo list (maybe a
specially-formatted comment such as `## END NESTED ##`).
in the few weeks i've been using the script so far (with a by now 80+
commit series), i'd have found nested abort useful about twice, while
repeated "flat" rewinds are par for the course. i'm also slightly
worried that i'd lose track of the stack and throw away too much (though
strictly speaking that's actually not unique to nesting; it would just
amplify the problem). my script already inserts a marker in the form of
"break\n\n", and it gets really weird after several rewinds if i don't
clean up. to make it less weird (and error-prone), one would have to
actually start a new todo list, that is, actually throw the rest of the
old todo list on a stack rather than prepending to it. so basically,
choose between linear and nested, but don't mix the two.