Skip to contentSkip to conversation

patman: add Series-commit-notes tag and section

PATCH Superseded Albert ARIBAUD 3 participants 3 messages Oct 13, 2013 – Nov 12, 2013

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 patman: add Series-commit-notes tag and section

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.

---

 tools/patman/commit.py      | 2 ++
 tools/patman/patchstream.py | 7 +++++--
 tools/patman/series.py      | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)
tools/patman/commit.py +2 -0
index 900cfb3..89cce7f 100644
@@ -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.
tools/patman/patchstream.py +5 -2
index c204523..4c20144 100644
@@ -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
tools/patman/series.py +1 -1
index 88c0d87..5eeb452 100644
@@ -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.
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/1 patman: add Series-commit-notes tag and section

Hello Albert, Simon.

Quoted 5 lines

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.

(Please correct me if I am wrong.)

In my understanding, "Series-" prefix implies that
the tag has an impact on the whole series.
For example, Series-to, Series-cc, Series-version, Series-prefix, etc.

If I am not misunderstanding, in this case 'Series-commit-notes' tag adds a ratinale part to the only patch file which this tag is given to.

How about dropping 'Series-' prefix?

Best Regards
Masahiro Yamada

#2 lore raw

PATCH 1/1 patman: add Series-commit-notes tag and section

Hi Massihiro,

Quoted 10 lines · Masahiro Yamada

Hello Albert, Simon.

Quoted 5 lines

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.

(Please correct me if I am wrong.)

Quoted 9 lines

In my understanding, "Series-" prefix implies that
the tag has an impact on the whole series.
For example, Series-to, Series-cc, Series-version, Series-prefix, etc.

If I am not misunderstanding, in this case 'Series-commit-notes' tag adds a ratinale part to the only patch file which this tag is given to.

How about dropping 'Series-' prefix?

Yes I think that is a good idea.

Regards,
Simon