mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Antonio Borneo <borneo.antonio@gmail.com>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
	Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: Antonio Borneo <borneo.antonio@gmail.com>, linux-kernel@vger.kernel.org
Subject: [PATCH] checkpatch: exclude gerrit's Change-Id line from commit description
Date: Mon, 10 Apr 2023 12:02:55 +0200	[thread overview]
Message-ID: <20230410100255.16755-1-borneo.antonio@gmail.com> (raw)

Checkpatch rejects patches that have empty commit description and
logs them with:
	WARNING:COMMIT_MESSAGE: Missing commit description - Add an appropriate one
But if the patch has a gerrit's Change-Id line placed before the
line Signed-off-by, then checkpatch considers the Change-Id line
as a valid commit description text.

Use the Change-Id tag as a marker of the end of the commit message,
thus not counting its line as part of the commit description.

This patch is not relevant for the Linux kernel development process
as gerrit is not involved and the Change-Id tag is rejected. But
other projects, like OpenOCD, base the development on gerrit and
reuse kernel's checkpatch with flag '--ignore GERRIT_CHANGE_ID'.

Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
---
 scripts/checkpatch.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index bd44d12965c9..5b2212d5907b 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3224,6 +3224,7 @@ sub process {
 
 # Check for Gerrit Change-Ids not in any patch context
 		if ($realfile eq '' && !$has_patch_separator && $line =~ /^\s*change-id:/i) {
+			$in_commit_log = 0;
 			if (ERROR("GERRIT_CHANGE_ID",
 			          "Remove Gerrit Change-Id's before submitting upstream\n" . $herecurr) &&
 			    $fix) {

base-commit: 09a9639e56c01c7a00d6c0ca63f4c7c41abe075d
-- 
2.40.0


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

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10 10:02 Antonio Borneo [this message]
2023-12-12  9:53 ` Antonio Borneo
2023-12-12 19:02   ` Joe Perches

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=20230410100255.16755-1-borneo.antonio@gmail.com \
    --to=borneo.antonio@gmail.com \
    --cc=apw@canonical.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®