diff mbox

[U-Boot,2/3] tools: patman: Handle missing 'END' for 'Cover-letter'

Message ID 1466779521-11667-2-git-send-email-bmeng.cn@gmail.com
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Bin Meng June 24, 2016, 2:45 p.m. UTC
If 'END' is missing in a 'Cover-letter' section, and that section
happens to show up at the very end of the commit message, patman
fails to generate cover letter for us. Handle this in CloseCommit
of patchstream.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 tools/patman/patchstream.py | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Simon Glass June 26, 2016, 2:54 a.m. UTC | #1
On 24 June 2016 at 08:45, Bin Meng <bmeng.cn@gmail.com> wrote:
> If 'END' is missing in a 'Cover-letter' section, and that section
> happens to show up at the very end of the commit message, patman
> fails to generate cover letter for us. Handle this in CloseCommit
> of patchstream.
>
> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
> ---
>
>  tools/patman/patchstream.py | 5 +++++
>  1 file changed, 5 insertions(+)

Acked-by: Simon Glass <sjg@chromium.org>

Can we generate a warning here?

>
> diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
> index eeeb5ea..5573326 100644
> --- a/tools/patman/patchstream.py
> +++ b/tools/patman/patchstream.py
> @@ -112,6 +112,11 @@ class PatchStream:
>          if self.commit and self.is_log:
>              self.series.AddCommit(self.commit)
>              self.commit = None
> +        # If 'END' is missing in a 'Cover-letter' section, and that section
> +        # happens to show up at the very end of the commit message, this is
> +        # the chance for us to fix it up.
> +        if self.in_section == 'cover' and self.is_log:
> +            self.series.cover = self.section
>
>      def ProcessLine(self, line):
>          """Process a single line of a patch file or commit log
> --
> 2.7.4
>
diff mbox

Patch

diff --git a/tools/patman/patchstream.py b/tools/patman/patchstream.py
index eeeb5ea..5573326 100644
--- a/tools/patman/patchstream.py
+++ b/tools/patman/patchstream.py
@@ -112,6 +112,11 @@  class PatchStream:
         if self.commit and self.is_log:
             self.series.AddCommit(self.commit)
             self.commit = None
+        # If 'END' is missing in a 'Cover-letter' section, and that section
+        # happens to show up at the very end of the commit message, this is
+        # the chance for us to fix it up.
+        if self.in_section == 'cover' and self.is_log:
+            self.series.cover = self.section
 
     def ProcessLine(self, line):
         """Process a single line of a patch file or commit log