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

[PATCH v2 0/2] test-lib.sh: do tests for color support after changing HOME

From
RHRichard Hansen <rhansen@bbn.com>
Date
Jan 6, 2015, 22:57 UTC
Message-ID
<1420585071-28973-1-git-send-email-rhansen@bbn.com>
In-Reply-To
<xmqq8uhfpw3s.fsf@gitster.dls.corp.google.com>
On 2015-01-06T11:06-08:00, Junio C Hamano wrote:
Show 23 quoted lines
>> +unset color
>>  while test "$#" -ne 0
>>  do
>>  	case "$1" in
>> @@ -258,40 +250,6 @@ then
>>  	verbose=t
>>  fi
>>  
>> -if test -n "$color"
>> ...
>> @@ -857,6 +815,52 @@ HOME="$TRASH_DIRECTORY"
>>  GNUPGHOME="$HOME/gnupg-home-not-used"
>>  export HOME GNUPGHOME
>>  
>> +# run the tput tests *after* changing HOME (in case ncurses needs
>> +# ~/.terminfo for $TERM)
>> +test -n "${color+set}" || [ "x$ORIGINAL_TERM" != "xdumb" ] && (
>
> OK, $color used to be boolean between '' (unset included) and 't',
> but now we do this after possibly processing the --no-color
> argument, so this is guarded slightly differently from the original.
>
> Makes sense.
I updated the commit message to make this change more obvious.
> This is a tangent but this patch shows 2 places out of the only
> three places we use [ ... ] construct (as opposed to a more
> traditionalist "test").  Perhaps we may want to fix them with a
> follow-up patch?
I added a prequel patch to address this.

Thank you for taking a look, Richard

Richard Hansen (2):
  use 'test ...' instead of '[ ... ]'
  test-lib.sh: do tests for color support after changing HOME
 t/test-lib.sh | 92 +++++++++++++++++++++++++++++++----------------------------
 1 file changed, 48 insertions(+), 44 deletions(-)
-- 
2.2.1
Previous: Junio C HamanoNext: Richard Hansen
Message 3 of 5 in “test-lib.sh: do tests for color support after changing HOME”
  1. test-lib.sh: do tests for color support after changing HOMERichard Hansen, Jan 5, 2015
  2. Junio C HamanoJan 6, 2015
  3. 0/2 test-lib.sh: do tests for color support after changing HOMERichard Hansen, Jan 6, 2015
  4. 1/2 use 'test ...' instead of '[ ... ]'Richard Hansen, Jan 6, 2015
  5. 2/2 test-lib.sh: do tests for color support after changing HOMERichard Hansen, Jan 6, 2015

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.