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

Re: [PATCH 1/2] t/test-lib.sh: support Korn shell by converting GIT_EXIT_OK to GIT_EXIT_CODE

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Oct 9, 2009, 20:01 UTC
Message-ID
<20091009200103.GB3610@progeny.tock>
In-Reply-To
<20091009192812.GA4122@progeny.tock>
Sorry to reply to self, just want to correct something I missed.
Jonathan Nieder wrote:
> Brandon Casey wrote:
Show 21 quoted lines
>> diff --git a/t/test-lib.sh b/t/test-lib.sh
>> index f2ca536..64e793a 100644
>> --- a/t/test-lib.sh
>> +++ b/t/test-lib.sh
> [...]
>> @@ -183,16 +183,16 @@ test_success=0
>>  
>>  die () {
>>  	code=$?
>> -	if test -n "$GIT_EXIT_OK"
>> +	if test -n "$GIT_EXIT_CODE"
>>  	then
>> -		exit $code
>> +		exit $GIT_EXIT_CODE
>>  	else
>>  		echo >&5 "FATAL: Unexpected exit with code $code"
>>  		exit 1
>>  	fi
>>  }
>
> $code can be removed now, right?

Sloppy reading on my part here: $code is still used in the error message on unexpected exits. The $code will be inaccurate on Suns in some cases, but this is only a cosmetic problem and the wrong value should be better than nothing for debugging.

> lib-httpd.sh:96:        trap 'code=$?; stop_httpd; (exit $code); die' EXIT
>
> It is probably worth changing that, too, unless GIT_TEST_HTTPD would not
> work on these platforms for some other reason.

This is used to support that error message, so it should not be changed, either.

Your patch looks good. Maybe the commit message could explain this, though?

Apologies for the noise, Jonathan

Previous: Jonathan NiederNext: Junio C Hamano
Message 4 of 11 in “t/test-lib.sh: support Korn shell by converting GIT_EXIT_OK to GIT_EXIT_CODE”
  1. 1/2 t/test-lib.sh: support Korn shell by converting GIT_EXIT_OK to GIT_EXIT_CODEBrandon Casey, Oct 9, 2009
  2. 2/2 Makefile: use the native (Korn) shell on SunOS and IRIX/IRIX64Brandon Casey, Oct 9, 2009
  3. Jonathan NiederOct 9, 2009
  4. Jonathan NiederOct 9, 2009
  5. Junio C HamanoOct 9, 2009
  6. Brandon CaseyOct 9, 2009
  7. Junio C HamanoOct 10, 2009
  8. Clemens BuchacherOct 10, 2009
  9. Andreas SchwabOct 10, 2009
  10. Ben WaltonOct 10, 2009
  11. Jeff KingOct 10, 2009

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.