All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] checkpatch: Tolerate upstream commit references
@ 2024-12-17 13:34 Petr Machata
  2025-01-07 11:55 ` Petr Machata
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Machata @ 2024-12-17 13:34 UTC (permalink / raw)
  To: Andy Whitcroft, Joe Perches
  Cc: Dwaipayan Ray, Lukas Bulwahn, linux-kernel, Andy Roulin,
	Petr Machata

Two forms of upstream commit references are used (and documented) for
stable kernels:

- [ Upstream commit <sha1> ]
- commit <sha1> upstream.

These are useful apart from stable kernel trees to other downstream
maintainers that wish to keep track of what came from where. But
checkpatch gives citations on patches annotated this way.

Extend checkpatch to tolerate the documented upstream references. This
reduces noise for downstream maintainers.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Andy Roulin <aroulin@nvidia.com>
---
 scripts/checkpatch.pl | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 9eed3683ad76..a6c81b38e413 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3340,6 +3340,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*\[ Upstream commit [0-9a-f]{40} ]/ &&
+		    $line !~ /^\s*commit [0-9a-f]{40}\s*upstream\./ &&
 		    $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.47.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-07 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-17 13:34 [PATCH] checkpatch: Tolerate upstream commit references Petr Machata
2025-01-07 11:55 ` Petr Machata

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.