From: Andreas Bießmann Date: Mon, 15 Apr 2013 23:52:18 +0000 (+0000) Subject: patman: fix gitutil for decorations X-Git-Tag: v2013.04~2 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=commitdiff_plain;h=2386060c16471f4cd183e6f8bce82450a7574ec6;hp=17dcbfb0876385b13739b1b1f2026edc8163b629 patman: fix gitutil for decorations The git config parameter log.decorate is quite useful when working with git. Patman, however can not handle the decorated output when parsing the commit. To prevent this use the '--no-decorate' switch for git-log. Signed-off-by: Andreas Bießmann Acked-by: Simon Glass --- diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index f48575013f..e31da1548d 100644 --- a/tools/patman/gitutil.py +++ b/tools/patman/gitutil.py @@ -39,7 +39,8 @@ def CountCommitsToBranch(): Return: Number of patches that exist on top of the branch """ - pipe = [['git', 'log', '--no-color', '--oneline', '@{upstream}..'], + pipe = [['git', 'log', '--no-color', '--oneline', '--no-decorate', + '@{upstream}..'], ['wc', '-l']] stdout = command.RunPipe(pipe, capture=True, oneline=True).stdout patch_count = int(stdout) @@ -92,7 +93,8 @@ def CountCommitsInBranch(git_dir, branch, include_upstream=False): Number of patches that exist on top of the branch """ range_expr = GetRangeInBranch(git_dir, branch, include_upstream) - pipe = [['git', '--git-dir', git_dir, 'log', '--oneline', range_expr], + pipe = [['git', '--git-dir', git_dir, 'log', '--oneline', '--no-decorate', + range_expr], ['wc', '-l']] result = command.RunPipe(pipe, capture=True, oneline=True) patch_count = int(result.stdout) @@ -106,7 +108,7 @@ def CountCommits(commit_range): Return: Number of patches that exist on top of the branch """ - pipe = [['git', 'log', '--oneline', commit_range], + pipe = [['git', 'log', '--oneline', '--no-decorate', commit_range], ['wc', '-l']] stdout = command.RunPipe(pipe, capture=True, oneline=True).stdout patch_count = int(stdout) diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index 7334ed30e3..b4337ccbdf 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -359,7 +359,8 @@ def GetMetaDataForList(commit_range, git_dir=None, count=None, Returns: A Series object containing information about the commits. """ - params = ['git', 'log', '--no-color', '--reverse', commit_range] + params = ['git', 'log', '--no-color', '--reverse', '--no-decorate', + commit_range] if count is not None: params[2:2] = ['-n%d' % count] if git_dir: