[PATCH] checkpatch: check GIT_COMMIT_ID for a maximum of 3 consecutive lines
From: Wei Yang
Date: Fri Aug 28 2026 - 23:16:52 EST
Following commit log would report git commit description style error.
Commit ee040cbd6e48 ("mm/page_alloc: don't warn about large allocations
with __GFP_NOFAIL") remove a warning on allocating large folio with
__GFP_NOFAIL, which was placed there by commit 903edea6c53f ("mm: warn
about illegal __GFP_NOFAIL usage in a more appropriate location and
manner").
Because the second commit description spans 3 lines.
While in commit 4ce9f9704578 ("checkpatch: improve GIT_COMMIT_ID test"), it
says it check commit description "for a maximum of 3 consecutive lines".
Add the missing iteration.
Signed-off-by: Wei Yang <richard.weiyang@xxxxxxxxx>
Cc: Joe Perches <joe@xxxxxxxxxxx>
---
scripts/checkpatch.pl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2b7a42bbdd94..0d1d0986c0d7 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3431,7 +3431,7 @@ sub process {
my $input = $line;
if ($line =~ /(?:\bcommit\s+[0-9a-f]{5,}|\bcommit\s*$)/i) {
- for (my $n = 0; $n < 2; $n++) {
+ for (my $n = 0; $n < 3; $n++) {
if ($input =~ /\bcommit\s+[0-9a-f]{5,}\s*($balanced_parens)/i) {
$orig_desc = $1;
$has_parens = 1;
--
2.34.1