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

Re: difftool--helper: exit when reading a prompt answer fails

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 27, 2014, 17:38 UTC
Message-ID
<xmqqa94hfm60.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20141027004148.GB81127@gmail.com>
David Aguilar <davvid@gmail.com> writes:
Show 17 quoted lines
>> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
>> index dc30a51..9cf5dc9 100755
>> --- a/t/t7800-difftool.sh
>> +++ b/t/t7800-difftool.sh
>> @@ -301,6 +301,14 @@ test_expect_success PERL 'say no to the second file' '
>>  	! grep br2 output
>>  '
>>  
>> +test_expect_success PERL 'ending prompt input with EOF' '
>> +	git difftool -x cat branch </dev/null >output &&
>> +	! grep master output &&
>> +	! grep branch output &&
>> +	! grep m2 output &&
>> +	! grep br2 output
>> +'
>
> Should we use "test_must_fail grep ..." instead of "! grep ..." here?

NO. We do not expect system-supplied "grep" to dump core and declare it as a test failure. test_must_fail is for catching an expected non-zero status exit from git commands, i.e. when we expect our binary to correctly notice some condition and report that fact with non-zero exit status, we do not want to mistake the binary segfaulting as working correctly.

Previous: Michael J GruberNext: David Aguilar
Message 5 of 9 in “difftool--helper: exit when reading a prompt answer fails”
  1. Johannes SixtOct 26, 2014
  2. David AguilarOct 27, 2014
  3. David AguilarOct 27, 2014
  4. Michael J GruberOct 27, 2014
  5. Junio C HamanoOct 27, 2014
  6. 1/2 t7800-difftool: use "test_must_fail grep" instead of "! grep"David Aguilar, Oct 27, 2014
  7. 2/2 difftool: add support for --trust-exit-codeDavid Aguilar, Oct 27, 2014
  8. Junio C HamanoOct 27, 2014
  9. David AguilarOct 28, 2014

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.