Git Mailing List Archive on lore.kernel.org
 help / color / Atom feed
From: Sebastien Bruckert <sbruckert.dev@gmail.com>
To: George Spelvin <lkml@sdf.org>
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org
Subject: Re: Feature request: rebase -i inside of rebase -i
Date: Tue, 7 Apr 2020 05:16:50 -0400
Message-ID: <CA+KXf2A7L1fRC3+rmDaME186CYf4yS+-dBgy_FkEFVh887N7MA@mail.gmail.com> (raw)
In-Reply-To: <20200406152450.GA9609@SDF.ORG>

Thank you for the more detailed explanation.

> I'm very interested in your opinion, but please note that we already have
> fixup commits for amending single commits in place.

Yes sorry, I still don't know everything about git and the way it
works. But I'm working on it!

> The problem that currently has no good solution arises when I realize
> halfway through a cleanup pass that things would be a lot simpler if I
> moved A to after C. "Hey, rather than adding A and then updating it to
> take C into account, how about I just do commit C first, and then add the
> final code of A in one step?"  That is, I want to change from O-A-B-C-D to
> O-B-C-A-D, but I didn't think of it until the rebase had reached O-A-B-C-.
>
> I think of it as "quilt pop" operation, taking patches off the
> applied list and putting them back on the todo.

Hmmm so you need some way to move C before your actual commit. To make
it like a pseudo command, some kind of "git rebase --reattach C
--after A"? This seems closer to your original idea.

Or why not modify "--edit-todo" to get commits from before your actual
point? It could works like this:

Before:
```
#pick b2a96fe O
#pick acb7459 A
#pick 0dac4a4 B
edit 1f54e51 C
edit cda2a7e D
```

After:
```
#pick b2a96fe O
edit 1f54e51 C
pick acb7459 A
pick 0dac4a4 B
edit cda2a7e D
```

So that you are still at C, but keeping the changes you made before on
A and B, and going through them only if you have conflicts.

If I understand your problem correctly (I hope), the more I think
about it, the more this modified "--edit-todo" makes sense too me.
Moreover, no problem for aborting, no big conceptual change, no change
in the way rebase works. Only --edit-todo is enhanced.

It coincides with what you were saying at the beginning:

> On Fri, Mar 20, 2020 at 03:51:20PM -0700, Junio C Hamano wrote:
> > I thought that "git rebase -i" allows the todo file (i.e. list of
> > steps still to be performed) to be edited before continuing; would>
> your use case be supported by using that?
>
> Mostly, if I do it very carefully, which is why I thought it would
> be easy to add.
>
> I think I could manually add the commits to the start of the todo file,
> reset --hard to the old state, and rebase --continue.
>
> But cutting and pasting commit IDs from git log into the todo file,
> and putting fixup commits in the right place is annoyingly fiddly.
> That's exactly the sort of thing computers are good at.

  reply index

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-20 22:30 George Spelvin
2020-03-20 22:51 ` Junio C Hamano
2020-03-20 23:35   ` George Spelvin
2020-03-21 10:51     ` Johannes Schindelin
2020-03-21 17:56       ` George Spelvin
2020-03-25 19:26         ` Johannes Schindelin
2020-03-26  0:18           ` George Spelvin
2020-03-28 14:25             ` Johannes Schindelin
2020-03-28 16:30               ` George Spelvin
2020-03-31  0:00                 ` George Spelvin
2020-03-31 10:57                   ` Philip Oakley
2020-03-31 13:36                     ` Phillip Wood
2020-04-01 16:43                       ` Philip Oakley
2020-04-07 15:54                         ` Phillip Wood
2020-04-04 12:17                   ` Johannes Schindelin
2020-04-04 12:39                 ` Johannes Schindelin
2020-04-04 17:41                   ` George Spelvin
2020-04-06 10:40                     ` Sebastien Bruckert
2020-04-06 15:24                       ` George Spelvin
2020-04-07  9:16                         ` Sebastien Bruckert [this message]
2020-04-07 19:03                           ` George Spelvin
2020-03-30 14:01               ` Philip Oakley
2020-03-30 18:18                 ` George Spelvin
2020-03-30 21:53                   ` Philip Oakley
2020-03-21  8:47 ` Johannes Sixt

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

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

  git send-email \
    --in-reply-to=CA+KXf2A7L1fRC3+rmDaME186CYf4yS+-dBgy_FkEFVh887N7MA@mail.gmail.com \
    --to=sbruckert.dev@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=lkml@sdf.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

Git Mailing List Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/git/0 git/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 git git/ https://lore.kernel.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.git


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git