Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Unified Diff: git_cl.py

Issue 20888002: Disable colors if not a tty. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Update references to 'git cl' in git cl smoke tests to $GIT_CL. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/basic.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_cl.py
diff --git a/git_cl.py b/git_cl.py
index 1dcb1fe8ca7bcc1bb0033997cd035a157f2b9e0c..0ac0f861c70875fef8e888316e18051cd873f25b 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -1169,8 +1169,12 @@ def CMDstatus(parser, args):
b, i, color = output.get()
tmp[b] = (i, color)
issue, color = tmp.pop(branch)
+ reset = Fore.RESET
+ if not sys.stdout.isatty():
+ color = ''
+ reset = ''
print ' %*s: %s%s%s' % (
- alignment, ShortBranchName(branch), color, issue, Fore.RESET)
+ alignment, ShortBranchName(branch), color, issue, reset)
cl = Changelist()
print
« no previous file with comments | « no previous file | tests/basic.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698