From patchwork Thu Mar 21 02:43:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 229534 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 5530E2C00BF for ; Thu, 21 Mar 2013 13:44:38 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7C5A44A02D; Thu, 21 Mar 2013 03:44:26 +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 OIbxKZEbmIOG; Thu, 21 Mar 2013 03:44:26 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0F6334A03B; Thu, 21 Mar 2013 03:43:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 07B204A02D for ; Thu, 21 Mar 2013 03:43:50 +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 vJnHWdayAOqA for ; Thu, 21 Mar 2013 03:43:49 +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-qa0-f74.google.com (mail-qa0-f74.google.com [209.85.216.74]) by theia.denx.de (Postfix) with ESMTPS id 4D79E4A036 for ; Thu, 21 Mar 2013 03:43:45 +0100 (CET) Received: by mail-qa0-f74.google.com with SMTP id k4so9864qaq.3 for ; Wed, 20 Mar 2013 19:43:44 -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=le5A6r2gfCW4vj90CkxC83Cx1wv9aI5JE06n3O0mh0Y=; b=YXf9yl+B4NrYt41UyoQ3pTEyBot87djVN+CMnxxMsFfyJV23FLRwHPgEVx+2lHz5W9 u2Sg/6e9NxmQeCyX2/70q0pEPn179WfN/pkEWPSprKVYmWBHGyAcuyWfXPMg5gEGFUYm 7bvqD3RN3MkabWqoZaHmxumZa64t10TF9XCqRof0zjJ7b6GHk9lBkA0NJoMS2vYFPTf9 r5Ib3wRNqyeTuvc4Sx+sPbzvEckHv70P1hxQ2zxEN4XrU7qF4s8rev9hNiHPgiM4Ii4x Wu8Qp1CTzU1kyopMMl7B8WlM6HEFaJFBbK1Octkm8qA2qGxScqIDVqhGuX8efu/UiMJe lk/A== X-Received: by 10.224.185.79 with SMTP id cn15mr4805191qab.4.1363833824750; Wed, 20 Mar 2013 19:43:44 -0700 (PDT) Received: from corp2gmr1-2.hot.corp.google.com (corp2gmr1-2.hot.corp.google.com [172.24.189.93]) by gmr-mx.google.com with ESMTPS id y8si2214352qcx.0.2013.03.20.19.43.44 (version=TLSv1.1 cipher=AES128-SHA bits=128/128); Wed, 20 Mar 2013 19:43:44 -0700 (PDT) Received: from kaka.mtv.corp.google.com (dhcp-172-22-162-57.mtv.corp.google.com [172.22.162.57]) by corp2gmr1-2.hot.corp.google.com (Postfix) with ESMTP id 7DFC75A4078; Wed, 20 Mar 2013 19:43:44 -0700 (PDT) Received: by kaka.mtv.corp.google.com (Postfix, from userid 121222) id 630F81611D2; Wed, 20 Mar 2013 19:43:44 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Wed, 20 Mar 2013 19:43:01 -0700 Message-Id: <1363833781-14557-9-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1363833781-14557-1-git-send-email-sjg@chromium.org> References: <1363833781-14557-1-git-send-email-sjg@chromium.org> X-Gm-Message-State: ALoCoQlYlzP9gea4bgyXkiYj7eDwHp+R+yq4MEW8fxrvb6z6JfmM9VxIuzcNdkajNsPXay/H6c1GYl5SZGVpwRCr2Ko3MHRyTzU183dnPCQz99RUb9hb/QM2TurNwo2ID0E809U9HCbfK/p9FriIWpRVGuF5+VFgY+EWprViLyAU/3WoeSinJ+/vPIW/zoXudiS9utKVMnU3 Cc: Tom Rini Subject: [U-Boot] [PATCH 8/8] 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 --- tools/patman/README | 8 +++++++- tools/patman/patchstream.py | 2 +- tools/patman/series.py | 8 ++++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/tools/patman/README b/tools/patman/README index d4e7f36..566f54d 100644 --- a/tools/patman/README +++ b/tools/patman/README @@ -225,9 +225,15 @@ 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. + 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 fe919be..7080a55 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,19 @@ class Series(dict): etc. """ final = [] + process_it = self.get('process_log', '') 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 not ('uniq' in process_it and text 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: