Try this git log grep:

$ git log --format=email -100000 | \
   grep -P '^(?:[\w\-]+-by:|cc:|CC:|Cc:)' | \
   grep -v 'stable\@' | \
   grep -P '\>.+'

This finds any signature/cc line with content after an
email address that end with a close angle bracket that
doesn't go to the stable address.

Think about what content after that close angle bracket
should and shoud not be allowed.

There are a few variants here:

o comments (optional whitespace, followed by '#' or '[' or '(' or c89)
o misuse of quote (around the whole name and address)
o Odd commas after '>' likely from defective cut'n'paste use

Then add this to the first grep to avoid the comments as above

$ git log --format=email -100000 | \
   grep -P '^(?:[\w\-]+-by:|cc:|CC:|Cc:)' | \
   grep -v 'stable\@' | \
   grep -P '\>.+' | \
   grep -vP '\>\s*(?:\#|\(|/\*|\[)'

Shouldn't all these be reported?
Are they if your patch is applied?

Then look at the addresses that do not have a close angle
bracket and also have more content after the email address.

$ git log --format=email -100000 | \
   grep -P '^(?:[\w\-]+-by:|cc:|CC:|Cc:)' | \
   grep -v 'stable@' | \
   grep -vP '<[\w\.\@\+\-]+>' | \
   grep -vP '[\w\.\@\+\-]+$'

What of all of these should be reported?

Happy testing...

Hi,
So I ran the tests and there are some interesting results.

The warnings were the same before and after this patch
was applied.

For illegal elements after the closing braces, there were
several errors for which no warnings were reported. These
are:

      6 Cc: Peter Zijlstra <[email protected]>,
      5 Reviewed-by: "Dietmar Eggemann <[email protected]>"
      1 Suggested-by: Julia Lawall <[email protected]>.
      1 Signed-off-by: Vishal Kulkarni <[email protected]>"
      1 Signed-off-by: Vishal Kulkarni <[email protected]>"
      1 Signed-off-by: Vishal Kulkarni <[email protected]>"
      1 Signed-off-by: Veerabhadrarao Badiganti <[email protected]> Link:
      1 Signed-off-by: Jingle Wu <[email protected]>.
      1 Reviewed-by: Tvrtko Ursulin <[email protected]>,
      1 Reviewed-by: Max Gurtovoy <[email protected] <mailto:[email protected]>>
      1 Reviewed-by: Maulik Shah <[email protected]> Thanks, Maulik
      1 Reviewed-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
      1 Reviewed-by: David Sterba <[email protected]>i
      1 Reviewed-by: David Sterba <[email protected]>c
      1 Reviewed-by: David Sterba <[email protected]>3
      1 Reviewed-by: Christoph Hellwig <[email protected]>,
      1 Reviewed-by: Christian König <[email protected]> for both.
      1 Reviewed-by: Christian König <[email protected]>.
      1 Reported-by: Randy Dunlap <[email protected]>>
      1 Reported-by: Qian Cai <[email protected]>>
      1 Reported-by: Qian Cai <[email protected]> writes:
      1 Reported-by: kernel test robot <[email protected]> for missing #include
      1 Reported-by: "kernelci.org bot" <[email protected]>"
      1 Reported-by: kbuild test robot <[email protected]>]
      1 Reported-by: Bob Sanders <[email protected]> and the LTP testsuite
      1 Cc: Wolfram Sang <[email protected]>,
      1 Cc: Valdis Kletnieks <[email protected]>,
      1 Cc: Tvrtko Ursulin <[email protected]>,
      1 CC: Stephen Rothwell <[email protected]>,
      1 Cc: Sia, Jee Heng <[email protected]>; [email protected]; [email protected]; [email protected]; Nathan Chancellor <[email protected]>
      1 Cc: Robert Sesek <[email protected]>,
      1 CC: Peter Zijlstra <[email protected]>,
      1 Cc: Omar Sandoval <[email protected]>,
      1 Cc: Michael Neuling <[email protected]> <[email protected]>
      1 Cc: Maxime Ripard <[email protected]>,
      1 Cc: "Martin K. Petersen" <[email protected]>,
      1 Cc: Mark Scott <[email protected]>,
      1 Cc: Mark Rutland <[email protected]>.
      1 Cc: Mark Rutland <[email protected]>,
      1 Cc: Mark Rutland <[email protected]>,
      1 Cc: Laurent Pinchart <[email protected]>,
      1 Cc: Kees Cook <[email protected]>,
      1 Cc: Jonas Karlman <[email protected]>,
      1 Cc: Jernej Skrabec <[email protected]>,
      1 Cc: Jason Wang <[email protected]>; Parav Pandit <[email protected]>; [email protected]; [email protected]; [email protected]
      1 Cc: Jann Horn <[email protected]>,
      1 Cc: James Bottomley <[email protected]>,
      1 Cc: Icenowy Zheng <[email protected]>,
      1 Cc: Dan Murphy <[email protected]>A
      1 Cc: Daniel Vetter <[email protected]>,
      1 Cc: Christoph Lameter <[email protected]>Cc: Pekka Enberg <[email protected]>
      1 Cc: Christoph Hellwig <[email protected]>,
      1 Cc: Christian König <[email protected]>.
      1 CC: "Chang S. Bae" <[email protected]>,
      1 Cc: Al Viro <[email protected]>e
      1 Acked-by: Thomas Bogendoerfer <[email protected]>A
      1 Acked-by: Geert Uytterhoeven <[email protected]>A


For cases with no closing '>', following cases were not
reported by checkpatch:

      6 Cc: [email protected],
      1 Reviewed-by: Max Gurtovoy <[email protected] <mailto:[email protected]>>
      1 Cc: [email protected],
      1 Cc: [email protected],
      1 Cc: [email protected],

So it's mostly extra commas at the end. But other
illegal characters were also there. Also in one or two
cases, multiple addresses were stacked together.
I think these all deserve to be reported.

Thanks,
Dwaipayan.

Reply via email to