Messages in this thread | | | Date | Thu, 8 Sep 2022 09:01:00 +1000 | From | Stephen Rothwell <> | Subject | Re: [PATCH] checkpatch: add check for fixes: tag |
| |
Hi Joe,
On Wed, 07 Sep 2022 08:18:31 -0700 Joe Perches <joe@perches.com> 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 [unhandled content-type:application/pgp-signature] | |