Skip to content

Commit

Permalink
checkpatch: Only consider certain signoffs
Browse files Browse the repository at this point in the history
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 <[email protected]>

should not trigger.

Signed-off-by: Aaron Conole <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
apconole authored and blp committed Jun 25, 2018
1 parent de8fa82 commit 3ccb889
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions utilities/checkpatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.")
Expand Down

0 comments on commit 3ccb889

Please sign in to comment.