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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Patrick Steinhardt <ps@xxxxxx> 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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]