Re: [PATCH] checkpatch: add check for fixes: tag

From: Stephen Rothwell
Date: Wed Sep 07 2022 - 19:01:20 EST


Hi Joe,

On Wed, 07 Sep 2022 08:18:31 -0700 Joe Perches <joe@xxxxxxxxxxx> wrote:
>
> I think the test better if it checks for a SHA1 after fixes.
>
> And IMO
>
> !(foo =~ /bar.../)
>
> is better written as
>
> foo !~ /bar.../
>
> so
>
> if ($in_commit_log &&
> $line =~ /^\s*Fixes:?\s*[0-9a-f]{5,}\b/i &&
> $line !~ /^Fixes: [0-9a-f]{12,40} \(\".*\"\)/)) {
>
> Though it's arguable that the SHA1 should _only_ be length 12
> and not longer.

It should be allowed to be longer - eventaully we will need to move on
from 12 as the repo gets bigger. Also, any line matching /^\s*Fixes:/i
should be checked, because people do add extra words before the SHA1
and sometimes just other text. You will get some hits that are not
meant to be Fixes tags, but very few.

--
Cheers,
Stephen Rothwell

Attachment: pgpXL4f_oAESK.pgp
Description: OpenPGP digital signature