From patchwork Tue Apr 16 09:52:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_Bie=C3=9Fmann?= X-Patchwork-Id: 236890 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 71B412C00EC for ; Tue, 16 Apr 2013 19:51:46 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8751B4A1BD; Tue, 16 Apr 2013 11:51:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O4ujValBFE28; Tue, 16 Apr 2013 11:51:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 95E8B4A1BE; Tue, 16 Apr 2013 11:51:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 075614A1BE for ; Tue, 16 Apr 2013 11:51:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qziTru-Q-E3e for ; Tue, 16 Apr 2013 11:51:37 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-we0-f171.google.com (mail-we0-f171.google.com [74.125.82.171]) by theia.denx.de (Postfix) with ESMTPS id 24F624A1BD for ; Tue, 16 Apr 2013 11:51:35 +0200 (CEST) Received: by mail-we0-f171.google.com with SMTP id i48so218348wef.16 for ; Tue, 16 Apr 2013 02:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=oEcIryCIYduTfDiHMG8LDnxAl82k2ROTspB5bqqkGH8=; b=VVFIXmw6QznLlBFCWqddqD8oYKdqkce/4Ga69a7/ci+a+KhNOxOc6jQxbWHAZKAqN5 u9YFZwv2FszXIn08w24XQHX6ybR0xks/W+4qNfUFWRiDq29mUcyM9dF3LsPae960dvQl W/gKkLeSzJY+W1aAmVNv2jifyyD6fWFoCwGue+rjObyiu0uTVeCGEmkjq4fkqX2g9n/P tVgZ6K3m7V+S36t8m6woK+D9Nrj7FlLMGas8vHYE5r1kZoydTpunqZxpKoSE64m9F616 ALptaO4UcY8Vr8+9gmPkZLVRGKduMDrhIKAlkW5cyWbvfNxsjrmVjmUgchjgAQTpPw/7 Q2Jw== X-Received: by 10.194.63.109 with SMTP id f13mr2540320wjs.11.1366105895628; Tue, 16 Apr 2013 02:51:35 -0700 (PDT) Received: from localhost ([2a01:198:47b:1:210:75ff:fe1a:cd1e]) by mx.google.com with ESMTPS id q18sm11619646wiw.8.2013.04.16.02.51.33 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 16 Apr 2013 02:51:34 -0700 (PDT) From: =?UTF-8?q?Andreas=20Bie=C3=9Fmann?= To: U-Boot ML Date: Tue, 16 Apr 2013 11:52:18 +0200 Message-Id: <1366105938-16485-1-git-send-email-andreas.devel@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1366104623-14911-1-git-send-email-andreas.devel@googlemail.com> References: <1366104623-14911-1-git-send-email-andreas.devel@googlemail.com> MIME-Version: 1.0 Subject: [U-Boot] [PATCH v2] patman: fix gitutil for decorations X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- 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(-) diff --git a/tools/patman/gitutil.py b/tools/patman/gitutil.py index f485750..e31da15 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 7334ed3..b4337cc 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: