* [PATCH v5] checkpatch: Tolerate upstream commit references
@ 2025-09-10 12:34 Petr Machata
0 siblings, 0 replies; only message in thread
From: Petr Machata @ 2025-09-10 12:34 UTC (permalink / raw)
To: Andy Whitcroft, Joe Perches, Dwaipayan Ray, Lukas Bulwahn
Cc: linux-kernel, Petr Machata
Two forms of upstream commit references are used (and documented) for
stable kernels:
- [ Upstream commit <sha1> ]
- commit <sha1> upstream.
Extend checkpatch so that it doesn't cite these. This reduces noise that
downstream maintainers experience when checkpatching patches that may
contain commit references of this sort.
In order to future-proof the script, allow also permutations of the above
styles: with a period or without, bracketed or not, capitalized or not. The
hash is recognized as at least 7 digits long, similarly to the "This
reverts commit" exclude below.
Signed-off-by: Petr Machata <petrm@nvidia.com>
---
Notes:
v5:
- No changes, just a ping.
v4:
- No changes, just a ping.
v3:
- Tolerate a couple more upstream commit reference styles.
v2:
- No changes, just a ping.
scripts/checkpatch.pl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index e722dd6fa8ef..53b21b4a4760 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3352,6 +3352,8 @@ sub process {
if ($perl_version_ok &&
$in_commit_log && !$commit_log_possible_stack_dump &&
$line !~ /^\s*(?:Link|Patchwork|http|https|BugLink|base-commit):/i &&
+ $line !~ /^(\[\s*)?[Uu]pstream commit [0-9a-f]{7,40}\.?(\s*])?/ &&
+ $line !~ /^(\[\s*)?[Cc]ommit\s*[0-9a-f]{7,40}\s*upstream\.?(\s*])?/ &&
$line !~ /^This reverts commit [0-9a-f]{7,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)) ||
--
2.49.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-09-10 12:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-10 12:34 [PATCH v5] checkpatch: Tolerate upstream commit references Petr Machata
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox