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

Re: [PATCH] rebase -i: restore autostash on abort

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 28, 2016, 19:02 UTC
Message-ID
<xmqqa8i587cx.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160628175704.26095-1-ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 9 quoted lines
> When we abort an interactive rebase we do so by calling
> `die_abort`, which cleans up after us by removing the rebase
> state directory. If the user has requested to use the autostash
> feature, though, the state directory may also contain a reference
> to the autostash, which will now be deleted.
>
> Fix the issue by trying to re-apply the autostash in `die_abort`.
> This will also handle the case where the autostash does not apply
> cleanly anymore by recording it in a user-visible stash.

I do not do autostash myself, but it is a good thing to try not to lose information ;-)

Show 8 quoted lines
> +test_expect_success 'restore autostash on editor failure' '
> +	test_when_finished "git reset --hard" &&
> +	echo uncommited-content >file0 &&
> +	(
> +		test_set_editor "false" &&
> +		test_must_fail git rebase -i --autostash HEAD^
> +	) &&
> +	echo uncommited-content >expected &&

While making sure this case works is crucial, it is not an interesting failure mode, is it? Can we also have "does not apply cleanly anymore" case, too?

> +	test_cmp expected file0
> +'
> +
>  test_done
Previous: Patrick SteinhardtNext: Matthieu Moy
Message 2 of 7 in “rebase -i: restore autostash on abort”
  1. rebase -i: restore autostash on abortPatrick Steinhardt, Jun 28, 2016
  2. Junio C HamanoJun 28, 2016
  3. Matthieu MoyJun 28, 2016
  4. Junio C HamanoJun 28, 2016
  5. Patrick SteinhardtJun 29, 2016
  6. rebase -i: restore autostash on abortPatrick Steinhardt, Jun 29, 2016
  7. Johannes SchindelinJun 29, 2016

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.