All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 8/8] patman: Add Series-process-log tag to sort/uniq change logs
Date: Wed, 20 Mar 2013 19:43:01 -0700	[thread overview]
Message-ID: <1363833781-14557-9-git-send-email-sjg@chromium.org> (raw)
In-Reply-To: <1363833781-14557-1-git-send-email-sjg@chromium.org>

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 <sjg@chromium.org>
---
 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 <email>
+ Cc: Their Name <email>
 	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:
-- 
1.8.1.3

  parent reply	other threads:[~2013-03-21  2:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21  2:42 [U-Boot] [PATCH 0/8] Various patman fixes Simon Glass
2013-03-21  2:42 ` [U-Boot] [PATCH 1/8] patman: Fix up checkpatch parsing to deal with 'CHECK' lines Simon Glass
2013-03-21 16:35   ` Doug Anderson
2013-03-26 22:12     ` Simon Glass
2013-03-21  2:42 ` [U-Boot] [PATCH 2/8] patman: Don't look for tags inside quotes Simon Glass
2013-03-21 16:50   ` Doug Anderson
2013-03-26 22:14     ` Simon Glass
2013-03-21  2:42 ` [U-Boot] [PATCH 3/8] patman: Minor help message/README fixes Simon Glass
2013-03-21 16:52   ` Doug Anderson
2013-03-21  2:42 ` [U-Boot] [PATCH 4/8] patman: Fix the comment in CheckTags to mention multiple tags Simon Glass
2013-03-21 16:53   ` Doug Anderson
2013-03-21  2:42 ` [U-Boot] [PATCH 5/8] patman: Provide option to ignore bad aliases Simon Glass
2013-03-21 17:09   ` Doug Anderson
2013-03-26 22:46     ` Simon Glass
2013-03-21  2:42 ` [U-Boot] [PATCH 6/8] patman: Add -a option to refrain from test-applying the patches Simon Glass
2013-03-21 17:12   ` Doug Anderson
2013-03-21  2:43 ` [U-Boot] [PATCH 7/8] patman: Add Cover-letter-cc tag to Cc cover letter to people Simon Glass
2013-03-21  3:46   ` Doug Anderson
2013-03-21  2:43 ` Simon Glass [this message]
2013-03-21 17:51   ` [U-Boot] [PATCH 8/8] patman: Add Series-process-log tag to sort/uniq change logs Doug Anderson
2013-03-26 22:15     ` Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1363833781-14557-9-git-send-email-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.