From: Johannes Schindelin Date: Mon, 07 Mar 2022 16:56:22 GMT Subject: Re: rewinding interactive rebases Message-ID: In-Reply-To: Hi Erik & Oswald, it's not really obvious from the text quoted below what is being discussed here, so let me simply top-post some thoughts: 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. Suggested approach: implement support for `git rebase -i --nested --onto `, i.e. a `--nested` option. The idea here is to generate a todo list (just like a fresh `git rebase -i --onto ` would have done) and _prepend_ it to the current todo list. 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 ##`). To support nested `git rebase --rebase-merges`, we would need to populate `state.labels` by reading `$GIT_DIR/rebase-merge/refs-to-delete` first thing when generating the todo list. For good measure, we should probably populate `state.commit2label` with this list, too, looking up the respective OIDs via `refs/rewritten/