diff mbox series

[RFC] checkpatch: Properly warn if Change-Id comes after first Signed-off-by line

Message ID 20200224235824.126361-1-john.stultz@linaro.org
State New
Headers show
Series [RFC] checkpatch: Properly warn if Change-Id comes after first Signed-off-by line | expand

Commit Message

John Stultz Feb. 24, 2020, 11:58 p.m. UTC
Quite often, the Change-Id may be between Signed-off-by: lines or
at the end of them. Unfortunately checkpatch won't catch these
cases as it disables in_commit_log when it catches the first
Signed-off-by line.

This has bitten me many many times.

I suspect this patch will break other use cases, so it probably
shouldn't be merged, but I wanted to share it just to help
illustrate the problem.

Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>

---
 scripts/checkpatch.pl | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.17.1
diff mbox series

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index a63380c6b0d2..a55340a9e3ea 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2609,7 +2609,8 @@  sub process {
 # Check the patch for a signoff:
 		if ($line =~ /^\s*signed-off-by:/i) {
 			$signoff++;
-			$in_commit_log = 0;
+			#Disabling in_commit_log here breaks Change-Id checking in some cases
+			#$in_commit_log = 0;
 			if ($author ne '') {
 				my $l = $line;
 				$l =~ s/"//g;