From patchwork Tue Mar 26 23:09:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 231572 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 E2D9D2C008C for ; Wed, 27 Mar 2013 10:11:12 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 22B7C4A02F; Wed, 27 Mar 2013 00:11:06 +0100 (CET) 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 q8PXbFjAubSf; Wed, 27 Mar 2013 00:11:05 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DCBB04A04B; Wed, 27 Mar 2013 00:10:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A006B4A028 for ; Wed, 27 Mar 2013 00:10:34 +0100 (CET) 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 PNhy1pdSDUJT for ; Wed, 27 Mar 2013 00:10:32 +0100 (CET) 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-qe0-f73.google.com (mail-qe0-f73.google.com [209.85.128.73]) by theia.denx.de (Postfix) with ESMTPS id ACD924A025 for ; Wed, 27 Mar 2013 00:10:27 +0100 (CET) Received: by mail-qe0-f73.google.com with SMTP id a11so777788qen.2 for ; Tue, 26 Mar 2013 16:10:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=zkzAKSkhnRTSvLP80GQUHTwZ1fE6GaP8RX/mE6ICWIE=; b=BbVFOuR0NvSYXwv58IyBGX+IkKIn3JATFX3MavHUYiyauVdqbHqzqcQ8X5gI9T5w3m 6n0aBfEohU4j9D0i3Syb9XUl0CBwCo/P/zGazhmCQMeRP4EQATF6T1yRsXRczHyupVTQ qhy6ifF9/6P081yeOD9BKYm/1ZGlsIUFyeIyp5L3BC/xlhh/tUyKjQI7cwSX3TdT+NnL Mq/tLI4QPPV4x4TVoB2IH6GcHwwq3TTkv057kwVy5/TQJ040cOxwru2GKGWO+hUyIdUp iB0eN6c8S5RSCWRXjMim4QGPB8TPYlauYgSOQ3k6/aFbwpLEc0IRhP6haHJ0qG1u0z3y q5Aw== X-Received: by 10.224.72.199 with SMTP id n7mr10153819qaj.5.1364339425497; Tue, 26 Mar 2013 16:10:25 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id c2si1379459qck.3.2013.03.26.16.10.25 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Tue, 26 Mar 2013 16:10:25 -0700 (PDT) Received: from kaka.mtv.corp.google.com (kaka.mtv.corp.google.com [172.22.83.1]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 3B0C631C1C6; Tue, 26 Mar 2013 16:10:25 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id EEDCB160756; Tue, 26 Mar 2013 16:10:24 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 26 Mar 2013 16:09:44 -0700 Message-Id: <1364339385-10035-7-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1364339385-10035-1-git-send-email-sjg@chromium.org> References: <1364339385-10035-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQnzoL2YkmITWYYRx38eVM9zvG48vmNVej8vh2ZJV8kA6iQPy90iQgLD+elBdxNHX+fQHhjhlolVigQj9nRBSWw6LhIL2bXviYtkUZaStgBEjvQAewCyvm6Wkt0x+0LM3oO73+FeDj/qk4ZipXunayxMYEvYqIXNtWob5jweRy6EbrzlFjRsE8fIbtcqGLwYE7+gfH1U Cc: Tom Rini Subject: [U-Boot] [PATCH v2 6/7] patman: Add Series-process-log tag to sort/uniq change logs 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de For some series with lots of changes it is annoying that duplicate change log items are not caught. It is also helpful sometimes to sort the change logs. Add a Series-process-log tag to enable this, which can be placed in a commit to control this. The change to the Cc: line is to fix a checkpatch warning. Signed-off-by: Simon Glass Reviewed-by: Doug Anderson --- Changes in v2: - Require sort, uniq tags to be comma-separated tools/patman/README | 9 ++++++++- tools/patman/patchstream.py | 2 +- tools/patman/series.py | 9 +++++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/tools/patman/README b/tools/patman/README index 9922f2a..0bdaa63 100644 --- a/tools/patman/README +++ b/tools/patman/README @@ -225,9 +225,16 @@ Series-changes: n to update the log there and then, knowing that the script will do the rest. -Cc: Their Name + Cc: Their Name This copies a single patch to another email address. +Series-process-log: sort, uniq + This tells patman to sort and/or uniq the change logs. It is + assumed that each change log entry is only a single line long. + Use 'sort' to sort the entries, and 'uniq' to include only + unique entries. If omitted, no change log processing is done. + Separate each tag with a comma. + Various other tags are silently removed, like these Chrome OS and Gerrit tags: diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py index a4f2f31..9d8a918 100644 --- a/tools/patman/patchstream.py +++ b/tools/patman/patchstream.py @@ -46,7 +46,7 @@ re_cover = re.compile('^Cover-letter:') re_cover_cc = re.compile('^Cover-letter-cc: *(.*)') # Patch series tag -re_series = re.compile('^Series-(\w*): *(.*)') +re_series = re.compile('^Series-([a-z-]*): *(.*)') # Commit tags that we want to collect and keep re_tag = re.compile('^(Tested-by|Acked-by|Reviewed-by|Cc): (.*)') diff --git a/tools/patman/series.py b/tools/patman/series.py index eb5a00c..783b3dd 100644 --- a/tools/patman/series.py +++ b/tools/patman/series.py @@ -28,7 +28,7 @@ import terminal # Series-xxx tags that we understand valid_series = ['to', 'cc', 'version', 'changes', 'prefix', 'notes', 'name', - 'cover-cc'] + 'cover-cc', 'process_log'] class Series(dict): """Holds information about a patch series, including all tags. @@ -167,15 +167,20 @@ class Series(dict): etc. """ final = [] + process_it = self.get('process_log', '').split(',') + process_it = [item.strip() for item in process_it] need_blank = False for change in sorted(self.changes, reverse=True): out = [] for this_commit, text in self.changes[change]: if commit and this_commit != commit: continue - out.append(text) + if 'uniq' not in process_it or text not in out: + out.append(text) line = 'Changes in v%d:' % change have_changes = len(out) > 0 + if 'sort' in process_it: + out = sorted(out) if have_changes: out.insert(0, line) else: