git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-rebase --undo-skip proposal

From
Jacob Keller <jacob.keller@gmail.com>
Date
Feb 15, 2018, 01:23 UTC
Message-ID
<CA+P7+xrNPe5106qSjs1BiGJ5RbVxmR=MiGNVeCAUbT3gR0cdLw@mail.gmail.com>
In-Reply-To
<nycvar.QRO.7.76.6.1802150148040.35@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz>

On Wed, Feb 14, 2018 at 4:53 PM, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:

Show 37 quoted lines
> Hi,
>
> On Wed, 14 Feb 2018, Psidium Guajava wrote:
>
>> On 2018-02-13 18:42 GMT-02:00 Stefan Beller <sbeller@google.com> wrote:
>> > On Tue, Feb 13, 2018 at 12:22 PM, Psidium Guajava <psiidium@gmail.com> wrote:
>> > I think this could also be done with "git rebase --edit-todo", which brings
>> > up the right file in your editor.
>>
>> Yeah that'd would only work if one started a rebase as a interactive
>> one, not am or merge.
>
> I agree that the original proposal was clearly for the non-interactive
> rebase (it talked about .git/rebase-apply/).
>
> The biggest problem with the feature request is not how useful it would
> be: I agree it would be useful. The biggest problem is that it is a little
> bit of an ill-defined problem.
>
> Imagine that you are rebasing 30 patches. Now, let's assume that patch #7
> causes a merge conflict, and you mistakenly call `git rebase --skip`.
>
> Now, when is the next possible time you can call `git rebase --undo-skip`?
> It could be after a merge conflict in #8. Or in interactive rebase, after
> a `pick` that was turned into an `edit`. Or, and this is also entirely
> possible, after the rebase finished with #30 without problems and the
> rebase is actually no longer in progress.
>
> So I do not think that there is a way, in general, to implement this
> feature. Even if you try to remember the state where a `--skip` was
> called, you would remember it in the .git/rebase-apply/ (or
> .git/rebase-merge/) directory, which is cleaned up after the rebase
> concluded successfully. So even then the information required to implement
> the feature would not necessarily be there, still, when it would be needed.
>
> Ciao,
> Johannes

Instead of an "--undo-skip", what if we ask the question of what the user actually wants?

Generally I'd assume that the user wishes to go back to the rebase and "pick" the commit back in.

So what if we just make "git rebase --skip" more verbose so that it more clearly spells out which commit is being skipped? Possibly even as extra lines of "the following patches were skipped during the rebase" after it completes?

Then it's up to the user to determine what to do with those commits, and there are many tools they could use to solve it, "git rebase -i, git cherry-pick, git reflog to restore to a previous and re-run the rebase, etc".

Thanks, Jake

Previous: Johannes SchindelinNext: Johannes Schindelin
Message 5 of 10 in “git-rebase --undo-skip proposal”
  1. Psidium GuajavaFeb 13, 2018
  2. Stefan BellerFeb 13, 2018
  3. Psidium GuajavaFeb 15, 2018
  4. Johannes SchindelinFeb 15, 2018
  5. Jacob KellerFeb 15, 2018
  6. Johannes SchindelinFeb 15, 2018
  7. Psidium GuajavaFeb 15, 2018
  8. Jacob KellerFeb 15, 2018
  9. Johannes SchindelinFeb 15, 2018
  10. Paul TanFeb 15, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.