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

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

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Jun 28, 2016, 20:42 UTC
Message-ID
<vpqvb0tqc46.fsf@anie.imag.fr>
In-Reply-To
<xmqqa8i587cx.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 14 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
>
>> +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?

It is "interesting" if you mean "matches real-life use-case", as it corresponds to the case where the user killed the editor (as reported by Daniel Hahler indeed, "Abort with ":cq", which will make Vim exit non-zero").

If you mean "likely to trigger nasty bugs", then indeed testing the case when apply_autostash fails is interesting: for example, calling die_abort when "stash apply" fails is tempting, but would lead to infinite recursion (it doesn't seem to be the case, but a test would be nice). Setting the editor to something that modifies uncommited-content before 'false' should do the trick.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 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.