* [PATCH] checkpatch: exclude gerrit's Change-Id line from commit description
@ 2023-04-10 10:02 Antonio Borneo
2023-12-12 9:53 ` Antonio Borneo
0 siblings, 1 reply; 3+ messages in thread
From: Antonio Borneo @ 2023-04-10 10:02 UTC (permalink / raw)
To: Andy Whitcroft, Joe Perches, Dwaipayan Ray, Lukas Bulwahn
Cc: Antonio Borneo, linux-kernel
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] checkpatch: exclude gerrit's Change-Id line from commit description
2023-04-10 10:02 [PATCH] checkpatch: exclude gerrit's Change-Id line from commit description Antonio Borneo
@ 2023-12-12 9:53 ` Antonio Borneo
2023-12-12 19:02 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Antonio Borneo @ 2023-12-12 9:53 UTC (permalink / raw)
To: Andy Whitcroft, Joe Perches, Dwaipayan Ray, Lukas Bulwahn
Cc: linux-kernel, borneo.antonio
On Mon, Apr 10, 2023, 12:03 Antonio Borneo <borneo.antonio@gmail.com> wrote:
> 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
>
Gentle ping about this patch
Best Regards
Antonio
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] checkpatch: exclude gerrit's Change-Id line from commit description
2023-12-12 9:53 ` Antonio Borneo
@ 2023-12-12 19:02 ` Joe Perches
0 siblings, 0 replies; 3+ messages in thread
From: Joe Perches @ 2023-12-12 19:02 UTC (permalink / raw)
To: Antonio Borneo, Andy Whitcroft, Dwaipayan Ray, Lukas Bulwahn; +Cc: linux-kernel
On Tue, 2023-12-12 at 10:53 +0100, Antonio Borneo wrote:
> On Mon, Apr 10, 2023, 12:03 Antonio Borneo <borneo.antonio@gmail.com> wrote:
> > 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
So don't expect me to pick it up for the linux kernel.
You are of course welcome to branch and include it in
your process.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-12-12 19:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-10 10:02 [PATCH] checkpatch: exclude gerrit's Change-Id line from commit description Antonio Borneo
2023-12-12 9:53 ` Antonio Borneo
2023-12-12 19:02 ` Joe Perches
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®