From: Tiffany Yang <ynaffit@google.com>
To: linux-kernel@vger.kernel.org
Cc: kernel-team@android.com, Andy Whitcroft <apw@canonical.com>,
Joe Perches <joe@perches.com>,
Dwaipayan Ray <dwaipayanray1@gmail.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>
Subject: [PATCH] checkpatch: Allow bare SHA-1 hashes in checkpatch commits
Date: Fri, 14 Nov 2025 15:31:53 -0800 [thread overview]
Message-ID: <20251114233150.396974-6-ynaffit@google.com> (raw)
In-Reply-To: <20251114233150.396974-4-ynaffit@google.com>
Commit messages for changes to checkpatch may use the output of the
"--git" option to illustrate the changed behavior. For example:
./scripts/checkpatch.pl --git d1934ed9803c
Don't report an improperly formed commit description when the SHA-1 hash
is being used as an example input to the checkpatch script.
Signed-off-by: Tiffany Yang <ynaffit@google.com>
---
scripts/checkpatch.pl | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f9d14115c416..c81787538b35 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3358,6 +3358,7 @@ sub process {
$in_commit_log && !$commit_log_possible_stack_dump &&
$line !~ /^\s*(?:Link|Patchwork|http|https|BugLink|base-commit):/i &&
$line !~ /^This reverts commit [0-9a-f]{7,40}/ &&
+ $line !~ /^\s*(?:(\$|%)\s+)?\.\/scripts\/checkpatch\.pl\s(?:-g|--git)\s[0-9a-f]{5,40}/ &&
(($line =~ /\bcommit\s+[0-9a-f]{5,}\b/i ||
($line =~ /\bcommit\s*$/i && defined($rawlines[$linenr]) && $rawlines[$linenr] =~ /^\s*[0-9a-f]{5,}\b/i)) ||
($line =~ /(?:\s|^)[0-9a-f]{12,40}(?:[\s"'\(\[]|$)/i &&
--
2.52.0.rc1.455.g30608eb744-goog
prev parent reply other threads:[~2025-11-14 23:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-14 23:31 [PATCH 1/3] checkpatch: handle variables that begin with 'case' Tiffany Yang
2025-11-14 23:31 ` [PATCH 2/3] checkpatch: check indentation on case without space Tiffany Yang
2025-11-14 23:31 ` Tiffany Yang [this message]
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=20251114233150.396974-6-ynaffit@google.com \
--to=ynaffit@google.com \
--cc=apw@canonical.com \
--cc=dwaipayanray1@gmail.com \
--cc=joe@perches.com \
--cc=kernel-team@android.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