mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Scott Branden <scott.branden@broadcom.com>
To: BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
	Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>
Cc: Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	linux-kernel@vger.kernel.org,
	Scott Branden <scott.branden@broadcom.com>
Subject: [PATCH] checkpatch: improve signature check on empty description
Date: Mon,  3 Apr 2023 16:18:21 -0700	[thread overview]
Message-ID: <20230403231821.4737-1-scott.branden@broadcom.com> (raw)

Existing check assumed there could be a single Signed-off-by line which
should be ignored when checking for an empty commit message.
Other lines with identifiers "Reported-by:", "Acked-by:", or anything
invented by the person who constructed the commit were counted as a
body of the commit message.

Improve the check for an empty body of the commit message by not counting
any lines that begin with a $signature or similar formatted line of a
keyword followed by a colon.

Signed-off-by: Scott Branden <scott.branden@broadcom.com>
---
 scripts/checkpatch.pl | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bd44d12965c9..5922a6df7f5d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2901,15 +2901,14 @@ sub process {
 		$cnt_lines++ if ($realcnt != 0);
 
 # Verify the existence of a commit log if appropriate
-# 2 is used because a $signature is counted in $commit_log_lines
 		if ($in_commit_log) {
-			if ($line !~ /^\s*$/) {
-				$commit_log_lines++;	#could be a $signature
+			if ($line !~ /^\s*($|[a-zA-Z0-9_-]+:)/) {
+				$commit_log_lines++;
 			}
-		} elsif ($has_commit_log && $commit_log_lines < 2) {
+		} elsif ($has_commit_log && $commit_log_lines < 1) {
 			WARN("COMMIT_MESSAGE",
 			     "Missing commit description - Add an appropriate one\n");
-			$commit_log_lines = 2;	#warn only once
+			$commit_log_lines = 1;	#warn only once
 		}
 
 # Check if the commit log has what seems like a diff which can confuse patch
-- 
2.40.0


                 reply	other threads:[~2023-04-03 23:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230403231821.4737-1-scott.branden@broadcom.com \
    --to=scott.branden@broadcom.com \
    --cc=apw@canonical.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®