Re: [PATCH 2/2] test-lib.sh: fix color support when tput needs ~/.terminfo

2015-06-17 Thread Junio C Hamano
Richard Hansen rhan...@bbn.com writes: We could test if the variable is set first (test -n ${foo+set}), at the cost of a bit more complexity. I do not mind it so much as you have it, but it does mean adding a new field needs to update two spots. I also don't like the duplicate list of

[PATCH 2/2] test-lib.sh: fix color support when tput needs ~/.terminfo

2015-06-17 Thread Richard Hansen
If tput needs ~/.terminfo for the current $TERM, then tput will succeed before HOME is changed to $TRASH_DIRECTORY (causing color to be set to 't') but fail afterward. One possible way to fix this is to treat HOME like TERM: back up the original value and temporarily restore it before say_color()

Re: [PATCH 2/2] test-lib.sh: fix color support when tput needs ~/.terminfo

2015-06-17 Thread Jeff King
On Wed, Jun 17, 2015 at 03:06:26PM -0400, Richard Hansen wrote: If tput needs ~/.terminfo for the current $TERM, then tput will succeed before HOME is changed to $TRASH_DIRECTORY (causing color to be set to 't') but fail afterward. One possible way to fix this is to treat HOME like TERM:

Re: [PATCH 2/2] test-lib.sh: fix color support when tput needs ~/.terminfo

2015-06-17 Thread Richard Hansen
On 2015-06-17 15:43, Jeff King wrote: On Wed, Jun 17, 2015 at 03:06:26PM -0400, Richard Hansen wrote: +say_color_error=$(tput bold; tput setaf 1) # bold red +say_color_skip=$(tput setaf 4) # blue +say_color_warn=$(tput setaf 3) # brown/yellow +say_color_pass=$(tput setaf 2) #

Re: [PATCH 2/2] test-lib.sh: fix color support when tput needs ~/.terminfo

2015-06-17 Thread Jeff King
On Wed, Jun 17, 2015 at 03:55:05PM -0400, Richard Hansen wrote: I do not mind it so much as you have it, but it does mean adding a new field needs to update two spots. I also don't like the duplicate list of color types, and I considered doing something similar to what you suggested, but