patman: fix gitutil for decorations
PATCH 1/1 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.
---
Since this is required for me to get patman working it would be great to have this trivial change in the upcoming release.
tools/patman/gitutil.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tools/patman/gitutil.py +2 -1
@@ -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)
Signature · 1 line
1.7.10.4
PATCH v2 1/1 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.
---
Changes in v2:
* add --no-decorate to all git-log instances
tools/patman/gitutil.py | 8 +++++--- tools/patman/patchstream.py | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-)
tools/patman/gitutil.py +5 -3
@@ -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)
tools/patman/patchstream.py +2 -1
@@ -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:
Signature · 1 line
1.7.10.4
PATCH v2 1/1 patman: fix gitutil for decorations
Quoted 5 lines · Andreas Bie?mann
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 <[email protected]>
Thanks.
PATCH v2 1/1 patman: fix gitutil for decorations
+Tom
Quoted 11 lines · Simon Glass
Quoted 5 lines · Andreas Bie?mann
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 <[email protected]>Thanks.
Acked-by Simon Glass <[email protected]>
Tom can you please pick this fix up also? It could cause people some problems.
Regards,
Simon
PATCH v2 1/1 patman: fix gitutil for decorations
Quoted 9 lines · Simon Glass
+Tom
Quoted 6 lines · Simon Glass
Quoted 4 lines · Andreas Bie?mann
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.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Signed-off-by Andreas Bie?mann <[email protected]>Thanks.
Acked-by Simon Glass <[email protected]>Tom can you please pick this fix up also? It could cause people some problems.
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130418/06949ab4/attachment.pgp>