git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
	"Phillip Wood" <phillip.wood123@gmail.com>,
	git@vger.kernel.org
Subject: Re: [RFC PATCH] rebase: implement --rewind
Date: Fri, 7 Apr 2023 09:00:45 +0200	[thread overview]
Message-ID: <ZC+/nYp2RRF9Gjrd@ugly> (raw)
In-Reply-To: <CAMP44s13z=hZHzU+EB7qBZnqQcmRGe4aknF=wocOK9uh6NHbcA@mail.gmail.com>

On Thu, Apr 06, 2023 at 07:21:39PM -0500, Felipe Contreras wrote:
>Imagine there was a rebase log for each branch, then `git rebase`
>could use that information to redo a previous rebase, even if that
>rebase was aborted. To restart your current rebase you could do `git
>rebase -i --redo 1` (1 being the previous one). If in the middle of
>that you decide actually your original approach was better, you just
>freely abort, and do `git rebase -i --redo 2`.
>
what exactly would you save to that log?
what comes to my mind is the todo file produced by my --rewind before 
the user edits it: the already rewritten commits (which can of course be 
saved as a single ref), and the remaining todo.
that would make it very much the same thing as the checkpoints phillip 
postulated and i expanded upon.

one difference to what i envisaged would be that one could easily resume 
a rebase one erroneously discarded entirely.

>Wouldn't that solve all the problems?
>
it would, but not necessarily optimally.

consider that after the initial implementation phase, my working branch 
is most of the time inside a 'reshape' (rebase -i --keep-base), and 
since i wrote the initial version of rewind, i initiate new reshapes 
much less often. i basically move freely between the commits in the 
branch.
inserting an additional step of aborting prior to redoing feels just 
clumsy.
at this point i'm actually thinking in the opposite direction: introduce 
commands that let me move by a few commits without even opening the todo 
editor (where have i seen that already? jj?).

the second aspect is performance/resource usage.
the intermediate abort would potentially touch a lot of files each time.  
that costs ssd life and often unneeded recompiles.
and given johannes' use case with *many* merges, rebasing from scratch 
would waste *quite* some time. as i pointed out in the other mail, my 
approach currently suffers from that as well, but it would be rather 
easy to sidestep it. your approach otoh would definitely need a 
fundamental improvement to the skipping algo (*).

(*) this of course sounds like a good idea regardless, but it's not 
necessarily wise to bet on it. i think the problem here is that redoing 
merges is *expected* to be "lossy". if they were marked for replay as 
proposed in https://github.com/gitgitgadget/git/pull/1491 , one could 
also just skip over them.


  reply	other threads:[~2023-04-07  7:01 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-23 16:22 [RFC PATCH] rebase: implement --rewind Oswald Buddenhagen
2023-03-28 14:53 ` Johannes Schindelin
2023-03-28 16:11   ` Oswald Buddenhagen
2023-04-05 12:07     ` Johannes Schindelin
2023-04-05 15:15       ` Oswald Buddenhagen
2023-04-06 10:45         ` Ævar Arnfjörð Bjarmason
2023-04-06 14:49           ` Oswald Buddenhagen
2023-04-07  0:21           ` Felipe Contreras
2023-04-07  7:00             ` Oswald Buddenhagen [this message]
2023-04-11 10:06               ` Phillip Wood
2023-04-06 10:01       ` Phillip Wood

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=ZC+/nYp2RRF9Gjrd@ugly \
    --to=oswald.buddenhagen@gmx.de \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=phillip.wood123@gmail.com \
    /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).