aboutsummaryrefslogtreecommitdiff
path: root/tools/patman/series.py
diff options
context:
space:
mode:
authorSean Anderson <seanga2@gmail.com>2020-05-04 16:28:34 -0400
committerSimon Glass <sjg@chromium.org>2020-05-29 20:55:45 -0600
commit6949f70c6d3e1cd4b93cafb8759e333a2e5a7f1e (patch)
treea9c6d96af8a9114a20bd912cc2b608d2062d8dff /tools/patman/series.py
parentb0436b94047caf4c2ec67b599581198317f395b1 (diff)
downloadu-boot-6949f70c6d3e1cd4b93cafb8759e333a2e5a7f1e.zip
u-boot-6949f70c6d3e1cd4b93cafb8759e333a2e5a7f1e.tar.gz
u-boot-6949f70c6d3e1cd4b93cafb8759e333a2e5a7f1e.tar.bz2
patman: Add new tags for finer-grained changelog control
By default patman generates a combined changelog for the cover letter. This may not always be desirable. Many patches may have the same changes. These can be coalesced with "Series-process-log: uniq", but this is imperfect. Similar changes like "Move foo to patch 7" will not be merged with the similar "Move foo to this patch from patch 6". Changes may not make sense outside of the patch they are written for. For example, a change line of "Add check for bar" does not make sense outside of the context in which bar might be checked for. Some changes like "New" or "Lint" may be repeated many times throughout different change logs, but carry no useful information in a summary. Lastly, I like to summarize the broad strokes of the changes I have made in the cover letter, while documenting all the details in the appropriate patches. I think this makes it easier to get a good feel for what has changed, without making it difficult to wade through every change in the whole series. This patch adds two new tags to add changelog entries which only appear in the cover letter, or only appear in the commit. Changes documented with "Commit-changes" will only appear in the commit, and will not appear in the cover letter. Changes documented with "Cover-changes" will not appear in any commit, and will only appear in the cover letter. Signed-off-by: Sean Anderson <seanga2@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools/patman/series.py')
-rw-r--r--tools/patman/series.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/patman/series.py b/tools/patman/series.py
index be6f061..ca7ca55 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -2,6 +2,9 @@
# Copyright (c) 2011 The Chromium OS Authors.
#
+from __future__ import print_function
+
+import collections
import itertools
import os
@@ -156,7 +159,15 @@ class Series(dict):
- Fix the widget
- Jog the dial
"""
- versions = sorted(self.changes, reverse=True)
+ # Collect changes from the series and this commit
+ changes = collections.defaultdict(list)
+ for version, changelist in self.changes.items():
+ changes[version] += changelist
+ if commit:
+ for version, changelist in commit.changes.items():
+ changes[version] += [[commit, text] for text in changelist]
+
+ versions = sorted(changes, reverse=True)
newest_version = 1
if 'version' in self:
newest_version = max(newest_version, int(self.version))
@@ -169,7 +180,7 @@ class Series(dict):
need_blank = False
for version in versions:
out = []
- for this_commit, text in self.changes[version]:
+ for this_commit, text in changes[version]:
if commit and this_commit != commit:
continue
if 'uniq' not in process_it or text not in out: