All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Machata <petrm@nvidia.com>
To: Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
	Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, Andy Roulin <aroulin@nvidia.com>,
	"Petr Machata" <petrm@nvidia.com>
Subject: [PATCH v2] checkpatch: Tolerate upstream commit references
Date: Tue, 10 Jun 2025 18:31:33 +0200	[thread overview]
Message-ID: <20250610163133.217957-1-petrm@nvidia.com> (raw)

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.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Andy Roulin <aroulin@nvidia.com>
---

Notes:
    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 664f7b7a622c..bd4405b59103 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -3351,6 +3351,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.49.0


             reply	other threads:[~2025-06-10 16:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10 16:31 Petr Machata [this message]
2025-06-10 19:39 ` [PATCH v2] checkpatch: Tolerate upstream commit references Joe Perches
2025-06-11 12:08   ` Petr Machata

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=20250610163133.217957-1-petrm@nvidia.com \
    --to=petrm@nvidia.com \
    --cc=apw@canonical.com \
    --cc=aroulin@nvidia.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=joe@perches.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 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.