[ovs-dev] [PATCH 2/2] checkpatch: Only consider certain signoffs

Aaron Conole aconole at redhat.com
Wed Jun 20 18:40:58 UTC 2018


Formatted patches can contain a heirarchy of sign-offs.  This is true when
merging patches from different projects (eg. backports to the datapath
directory from the linux net project).

This means that a submitted backport will contain multiple signed-off
tags, and not all should be considered.

This commit updates checkpatch to only consider those signoff lines which
start at the beginning of a line.  So the following:

  Signed-off-by: Foo Bar <foo at bar.com>

should not trigger.

Signed-off-by: Aaron Conole <aconole at redhat.com>
---
 utilities/checkpatch.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index cd781b576..5a6d5f5ff 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -623,9 +623,9 @@ def ovs_checkpatch_parse(text, filename):
     hunks = re.compile('^(---|\+\+\+) (\S+)')
     hunk_differences = re.compile(
         r'^@@ ([0-9-+]+),([0-9-+]+) ([0-9-+]+),([0-9-+]+) @@')
-    is_signature = re.compile(r'((\s*Signed-off-by: )(.*))$',
+    is_signature = re.compile(r'^(Signed-off-by: )(.*)$',
                               re.I | re.M | re.S)
-    is_co_author = re.compile(r'(\s*(Co-authored-by: )(.*))$',
+    is_co_author = re.compile(r'^(Co-authored-by: )(.*)$',
                               re.I | re.M | re.S)
     is_gerrit_change_id = re.compile(r'(\s*(change-id: )(.*))$',
                                      re.I | re.M | re.S)
@@ -664,10 +664,10 @@ def ovs_checkpatch_parse(text, filename):
                         print_error("Co-authored-by/Signed-off-by corruption")
             elif is_signature.match(line):
                 m = is_signature.match(line)
-                signatures.append(m.group(3))
+                signatures.append(m.group(2))
             elif is_co_author.match(line):
                 m = is_co_author.match(line)
-                co_authors.append(m.group(3))
+                co_authors.append(m.group(2))
             elif is_gerrit_change_id.match(line):
                 print_error(
                     "Remove Gerrit Change-Id's before submitting upstream.")
-- 
2.14.3



More information about the dev mailing list