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

Re: [PATCH] rebase: apply and cleanup autostash when rebase fails to start

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 14, 2024, 17:27 UTC
Message-ID
<xmqq8qwzypz2.fsf@gitster.g>
In-Reply-To
<b676bd17-1cc8-4639-acb7-675dde32a1ae@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 6 quoted lines
> Applying the stash should not fail because the rebase has not started
> and so HEAD, the index and the worktree are unchanged since the stash
> was created. If it does fail for some reason then apply_autostash()
> creates a new entry under refs/stash. We definitely do want to remove
> the directory otherwise we're left with the inconsistent state we're
> tying to fix.

If it is not expected to fail 99% of times, it feels more prudent to abort loudly without making further damage to lose information and ask the user to check what happened in the working tree, rather than blindly removing the clue to understand what went wrong. For example, could the reason why applying the stash failed be because the user forgot that the working tree was being used for rebasing and mucked with its contents from say another terminal?

Thanks.
Previous: Phillip WoodNext: Phillip Wood
Message 4 of 10 in “rebase: apply and cleanup autostash when rebase fails to start”
  1. rebase: apply and cleanup autostash when rebase fails to startPhillip Wood via GitGitGadget, Aug 14, 2024
  2. Patrick SteinhardtAug 14, 2024
  3. Phillip WoodAug 14, 2024
  4. Junio C HamanoAug 14, 2024
  5. Phillip WoodAug 15, 2024
  6. Junio C HamanoSep 8, 2024
  7. Junio C HamanoSep 8, 2024
  8. rebase: apply and cleanup autostash when rebase fails to startPhillip Wood via GitGitGadget, Sep 2, 2024
  9. Junio C HamanoSep 8, 2024
  10. Junio C HamanoSep 12, 2024

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.