git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Erik Cervin Edin <erik@cervined.in>, git@vger.kernel.org
Subject: Re: rewinding interactive rebases
Date: Mon, 7 Mar 2022 20:08:19 +0100	[thread overview]
Message-ID: <YiZYI8/jY37hZxxa@ugly> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.2203071745590.11118@tvgsbejvaqbjf.bet>

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.


      reply	other threads:[~2022-03-07 19:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-21 19:06 rewinding interactive rebases Oswald Buddenhagen
2022-03-01  9:24 ` Erik Cervin Edin
2022-03-07 16:56   ` Johannes Schindelin
2022-03-07 19:08     ` Oswald Buddenhagen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YiZYI8/jY37hZxxa@ugly \
    --to=oswald.buddenhagen@gmx.de \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=erik@cervined.in \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).