import checkpatch
import settings
+# True to use --no-decorate - we check this in Setup()
+use_no_decorate = True
+
def LogCmd(commit_range, git_dir=None, oneline=False, reverse=False,
count=None):
"""Create a command to perform a 'git log'
cmd += ['log', '--no-color']
if oneline:
cmd.append('--oneline')
- cmd.append('--no-decorate')
+ if use_no_decorate:
+ cmd.append('--no-decorate')
if count is not None:
cmd.append('-n%d' % count)
if commit_range:
alias_fname = GetAliasFile()
if alias_fname:
settings.ReadGitAliases(alias_fname)
+ cmd = LogCmd(None, count=0)
+ use_no_decorate = (command.RunPipe([cmd], raise_on_error=False)
+ .return_code == 0)
def GetHead():
"""Get the hash of the current HEAD