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

Re: [PATCH] rebase -i: redo tasks that die during cherry-pick

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 29, 2015, 17:15 UTC
Message-ID
<xmqq7fsu6ek4.fsf@gitster.dls.corp.google.com>
In-Reply-To
<42512fad738e0ec47a8cdb6e6e92e994@www.dscho.org>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 30 quoted lines
> Hi,
>
> On 2015-04-29 00:55, Phil Hord wrote:
>> When rebase--interactive processes a task, it removes the item from
>> the todo list and appends it to another list of executed tasks. If a
>> pick (this includes squash and fixup) fails before the index has
>> recorded the changes, take the corresponding item and put it on the todo
>> list again. Otherwise, the changes introduced by the scheduled commit
>> would be lost.
>> 
>> That kind of decision is possible since the cherry-pick command
>> signals why it failed to apply the changes of the given commit. Either
>> the changes are recorded in the index using a conflict (return value 1)
>> and rebase does not continue until they are resolved or the changes
>> are not recorded in the index (return value neither 0 nor 1) and
>> rebase has to try again with the same task.
>> 
>> Add a test cases for regression testing to the "rebase-interactive"
>> test suite.
>> 
>> Signed-off-by: Fabian Ruch <bafain@gmail.com>
>> Signed-off-by: Phil Hord <hordp@cisco.com>
>> ---
>
> ACK.
>
> It would be even nicer to avoid removing the task from the `todo` list
> until it has been performed correctly, of course, but I believe that
> would require a much more invasive patch. So this here patch is fine
> with me.
Thanks, will queue.

Aside from the "much more invasive" possibility, the patch makes me wonder if it would have been a better design to have a static "todo" with a "current" pointer as two state files. Then reschedule would have been just the matter of decrementing the number in "current", instead of "grab the last line of one file and prepend to the other file, and then lose the last line".

Previous: Johannes SchindelinNext: Phil Hord
Message 3 of 7 in “rebase -i: redo tasks that die during cherry-pick”
  1. rebase -i: redo tasks that die during cherry-pickPhil Hord, Apr 28, 2015
  2. Johannes SchindelinApr 28, 2015
  3. Junio C HamanoApr 29, 2015
  4. Phil HordApr 29, 2015
  5. Junio C HamanoApr 29, 2015
  6. rebase -i's todo/done list, was Re: [PATCH] rebase -i: redo tasks that die during cherry-pickJohannes Schindelin, Apr 30, 2015
  7. Fabian RuchApr 30, 2015

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.