[U-Boot] [PATCH v1] patman: add Series-commit-notes tag and section
Albert ARIBAUD
albert.u.boot at aribaud.net
Sun Oct 13 09:09:29 CEST 2013
Sometimes a commit should have notes enclosed with it rather
than withing the cover letter -- possibly even because there
is no cover letter. Add 'Series-commit-notes' tag, similar to
'Series-notes'; lines between this tag and the next END line
are inserted in the patch right after the '---' separator line.
Signed-off-by: Albert ARIBAUD <albert.u.boot at aribaud.net>
---
tools/patman/commit.py | 2 ++
tools/patman/patchstream.py | 7 +++++--
tools/patman/series.py | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/tools/patman/commit.py b/tools/patman/commit.py
index 900cfb3..89cce7f 100644
--- a/tools/patman/commit.py
+++ b/tools/patman/commit.py
@@ -21,6 +21,7 @@ class Commit:
changes: Dict containing a list of changes (single line strings).
The dict is indexed by change version (an integer)
cc_list: List of people to aliases/emails to cc on this commit
+ notes: List of lines in the commit (not series) notes
"""
def __init__(self, hash):
self.hash = hash
@@ -28,6 +29,7 @@ class Commit:
self.tags = []
self.changes = {}
self.cc_list = []
+ self.notes = []
def AddChange(self, version, info):
"""Add a new change line to the change list for a version.
diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index c204523..4c20144 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -84,7 +84,7 @@ class PatchStream:
name: Tag name (part after 'Series-')
value: Tag value (part after 'Series-xxx: ')
"""
- if name == 'notes':
+ if (name == 'notes' or name == 'commit-notes'):
self.in_section = name
self.skip_blank = False
if self.is_log:
@@ -165,6 +165,9 @@ class PatchStream:
elif self.in_section == 'notes':
if self.is_log:
self.series.notes += self.section
+ elif self.in_section == 'commit-notes':
+ if self.is_log:
+ self.commit.notes += self.section
else:
self.warn.append("Unknown section '%s'" % self.in_section)
self.in_section = None
@@ -276,7 +279,7 @@ class PatchStream:
out = []
log = self.series.MakeChangeLog(self.commit)
out += self.FormatTags(self.tags)
- out += [line] + log
+ out += [line] + self.commit.notes + [''] + log
elif self.found_test:
if not re_allowed_after_test.match(line):
self.lines_after_test += 1
diff --git a/tools/patman/series.py b/tools/patman/series.py
index 88c0d87..5eeb452 100644
--- a/tools/patman/series.py
+++ b/tools/patman/series.py
@@ -12,7 +12,7 @@ import terminal
# Series-xxx tags that we understand
valid_series = ['to', 'cc', 'version', 'changes', 'prefix', 'notes', 'name',
- 'cover-cc', 'process_log']
+ 'cover-cc', 'process_log', 'commit_notes']
class Series(dict):
"""Holds information about a patch series, including all tags.
--
1.8.3.2
More information about the U-Boot
mailing list