From: Petr Machata <petrm@nvidia.com>
To: Joe Perches <joe@perches.com>
Cc: Petr Machata <petrm@nvidia.com>,
Andy Whitcroft <apw@canonical.com>,
Dwaipayan Ray <dwaipayanray1@gmail.com>,
Lukas Bulwahn <lukas.bulwahn@gmail.com>,
<linux-kernel@vger.kernel.org>, Andy Roulin <aroulin@nvidia.com>
Subject: Re: [PATCH v2] checkpatch: Tolerate upstream commit references
Date: Wed, 11 Jun 2025 14:08:57 +0200 [thread overview]
Message-ID: <87sek6iamq.fsf@nvidia.com> (raw)
In-Reply-To: <4dfdbc14dd374772e6230d88b95d9c5392b1112d.camel@perches.com>
Joe Perches <joe@perches.com> writes:
> On Tue, 2025-06-10 at 18:31 +0200, Petr Machata wrote:
>> Two forms of upstream commit references are used (and documented) for
>> stable kernels:
>>
>> - [ Upstream commit <sha1> ]
>> - commit <sha1> upstream.
>
> Is the sha1 never abbreviated?
I mean, as per the spec it isn't. I want to make sure I don't let false
negatives in, that's the motivation for just going purely by the spec.
>> diff --git 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\./ &&
>
> always 40 chars?
>
>> $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)) ||
>
> In stable I see a few like:
>
> commit fef912bf860e upstream.
> commit 98af4d4df889 upstream.
There are a couple hits, but most come from 2018, one from 2021 and one
from 2022. My intuition is to ignore these because of the combination of
how old and how rare they are, but maybe it's better to assume a slip
like this will come up at some point again.
>
> and
>
> [ commit d3bd7413e0ca40b60cf60d4003246d067cafdeda upstream ]
> [ commit 979d63d50c0c0f7bc537bf821e056cc9fe5abd38 upstream ]
Yeah, there's a bunch of these in 2019.
> and some with an upper case Commit
>
> Commit d6951f582cc50ba0ad22ef46b599740966599b14 upstream.
OK, this one seems to be used on occasion. Even see hits from this year.
I think it might make sense to support this as well. Hmm, and then this
in brackets seems to be used a bunch, too.
So maybe I should generalize it a bit and ignore the hash check if
either of these hits?
(\[ )?[Uu]pstream commit [0-9a-f]{12,40}\.?( ])?
(\[ )?[Cc]ommit [0-9a-f]{12,40} upstream\.?( ])?
prev parent reply other threads:[~2025-06-11 15:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 16:31 [PATCH v2] checkpatch: Tolerate upstream commit references Petr Machata
2025-06-10 19:39 ` Joe Perches
2025-06-11 12:08 ` Petr Machata [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=87sek6iamq.fsf@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.