Patchwork [U-Boot,v1] patman: add Series-commit-notes tag and section

login
register
mail settings
Submitter Albert ARIBAUD
Date Oct. 13, 2013, 7:09 a.m.
Message ID <1381648169-24154-1-git-send-email-albert.u.boot@aribaud.net>
Download mbox | patch
Permalink /patch/283057/
State Superseded
Delegated to: Simon Glass
Headers show

Comments

Albert ARIBAUD - Oct. 13, 2013, 7:09 a.m.
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@aribaud.net>
---

 tools/patman/commit.py      | 2 ++
 tools/patman/patchstream.py | 7 +++++--
 tools/patman/series.py      | 2 +-
 3 files changed, 8 insertions(+), 3 deletions(-)
Masahiro Yamada - Nov. 12, 2013, 1:22 a.m.
Hello Albert, Simon.

> 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
Simon Glass - Nov. 12, 2013, 4:02 a.m.
Hi Massihiro,

On Mon, Nov 11, 2013 at 6:22 PM, Masahiro Yamada
<yamada.m@jp.panasonic.com>wrote:

> Hello Albert, Simon.
>
> > 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?
>

Yes I think that is a good idea.

Regards,
Simon

Patch

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.