File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 33
44from __future__ import unicode_literals
55
6- import subprocess
76import argparse
87import datetime
98import pygit2
10- import sys
119import re
10+ import subprocess
11+ import sys
1212
1313def find_toplevel ():
1414 try :
@@ -62,6 +62,7 @@ def main():
6262 parser .add_argument ('--show-dates' , action = 'store_true' , help = 'Show dates in %Y-%m-%d %H:%M:%S' )
6363
6464 parser .add_argument ('--all' , action = 'store_true' , help = 'Show commits from all users' )
65+ parser .add_argument ('--always-colors' , action = 'store_true' , help = 'Always force colored output' )
6566
6667 top = find_toplevel ()
6768
@@ -99,7 +100,7 @@ def main():
99100 author_format_str = ' | %s <%s>'
100101 commit_format_str = '%s %s%s'
101102
102- if sys .stdout .isatty ():
103+ if sys .stdout .isatty () or args . always_colors :
103104 author_format_str = ' \033 [31m| %s <%s>\033 [0m'
104105 commit_format_str = '\033 [33m%s\033 [0m %s%s'
105106
You can’t perform that action at this time.
0 commit comments