diff mbox

[ovs-dev,1/4] checkpatch: Don't allow Gerrit Change-Ids.

Message ID 1500029844-846-2-git-send-email-i.maximets@samsung.com
State Accepted
Headers show

Commit Message

Ilya Maximets July 14, 2017, 10:57 a.m. UTC
Local Gerrit Change-Ids are not welcome in common repository.
Inspired by checkpatch.pl from Linux Kernel.

Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
---
 utilities/checkpatch.py | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Aaron Conole July 17, 2017, 6:45 p.m. UTC | #1
Ilya Maximets <i.maximets@samsung.com> writes:

> Local Gerrit Change-Ids are not welcome in common repository.
> Inspired by checkpatch.pl from Linux Kernel.
>
> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> ---

I've not seen gerrit change-id's fly by before.  OTOH, they can
interfere with git log --grep="" when looking for Fixes: lines, so I'm
okay with a rejection here.

Acked-by: Aaron Conole <aconole@redhat.com>
diff mbox

Patch

diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py
index 65d188d..fe266ac 100755
--- a/utilities/checkpatch.py
+++ b/utilities/checkpatch.py
@@ -320,6 +320,8 @@  def ovs_checkpatch_parse(text, filename):
                               re.I | re.M | re.S)
     is_co_author = re.compile(r'(\s*(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)
 
     for line in text.split('\n'):
         if current_file != previous_file:
@@ -357,6 +359,10 @@  def ovs_checkpatch_parse(text, filename):
             elif is_co_author.match(line):
                 m = is_co_author.match(line)
                 co_authors.append(m.group(3))
+            elif is_gerrit_change_id.match(line):
+                print_error(
+                    "Remove Gerrit Change-Id's before submitting upstream.")
+                print("%d: %s\n" % (lineno, line))
         elif parse == 2:
             newfile = hunks.match(line)
             if newfile: