Commit 645b271a authored by Simon Glass's avatar Simon Glass
Browse files

patman: Add Series-process-log tag to sort/uniq change logs

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

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: default avatarSimon Glass <>
Reviewed-by: default avatarDoug Anderson <>
parent 902a9715
......@@ -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 <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.
Separate each tag with a comma.
Various other tags are silently removed, like these Chrome OS and
Gerrit tags:
......@@ -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): (.*)')
......@@ -28,7 +28,7 @@ import terminal
# Series-xxx tags that we understand
valid_series = ['to', 'cc', 'version', 'changes', 'prefix', 'notes', 'name',
'cover-cc', 'process_log']
class Series(dict):
"""Holds information about a patch series, including all tags.
......@@ -167,15 +167,20 @@ class Series(dict):
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:
if 'uniq' not in process_it or text not in out:
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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment