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

[PATCH] Do no colorify test output if stdout is not a terminal

From
Alex Riesen <raa.lkml@gmail.com>
Date
Nov 1, 2007, 14:01 UTC
Message-ID
<20071101140158.GA14475@steel.home>
like when the output is redirected into a file in a cron job.
---
 t/test-lib.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 714de6e..603a8cd 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -60,6 +60,7 @@ esac
 # . ./test-lib.sh
 
 [ "x$TERM" != "xdumb" ] &&
+	[ -t 1 ] &&
 	tput bold >/dev/null 2>&1 &&
 	tput setaf 1 >/dev/null 2>&1 &&
 	tput sgr0 >/dev/null 2>&1 &&
-- 
1.5.3.4.549.g2789
Next: Junio C Hamano
Message 1 of 2 in “Do no colorify test output if stdout is not a terminal”
  1. Do no colorify test output if stdout is not a terminalAlex Riesen, Nov 1, 2007
  2. Junio C HamanoNov 1, 2007

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.