Re: [PATCH] checkpatch: improve handling of email comments
From: Dwaipayan Ray
Date: Sat Oct 31 2020 - 17:09:06 EST
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 <peterz@xxxxxxxxxxxxx>,
5 Reviewed-by: "Dietmar Eggemann <dietmar.eggemann@xxxxxxx>"
1 Suggested-by: Julia Lawall <julia.lawall@xxxxxxx>.
1 Signed-off-by: Vishal Kulkarni <vishal@xxxxxxxxxxx>"
1 Signed-off-by: Vishal Kulkarni <vishal@xxxxxxxxxxx>"
1 Signed-off-by: Vishal Kulkarni <vishal@xxxxxxxxxxx>"
1 Signed-off-by: Veerabhadrarao Badiganti
<vbadigan@xxxxxxxxxxxxxx> Link:
1 Signed-off-by: Jingle Wu <jingle.wu@xxxxxxxxxx>.
1 Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxxxxxxx>,
1 Reviewed-by: Max Gurtovoy <maxg@xxxxxxxxxxxx
<mailto:maxg@xxxxxxxxxxxx>>
1 Reviewed-by: Maulik Shah <mkshah@xxxxxxxxxxxxxx> Thanks, Maulik
1 Reviewed-by: Marc Zyngier <maz@xxxxxxxxxx> Link:
https://lore.kernel.org/r/20200826112331.047917603@xxxxxxxxxxxxx
1 Reviewed-by: David Sterba <dsterba@xxxxxxxx>i
1 Reviewed-by: David Sterba <dsterba@xxxxxxxx>c
1 Reviewed-by: David Sterba <dsterba@xxxxxxxx>3
1 Reviewed-by: Christoph Hellwig <hch@xxxxxx>,
1 Reviewed-by: Christian König <christian.koenig@xxxxxxx> for both.
1 Reviewed-by: Christian König <christian.koenig@xxxxxxx>.
1 Reported-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>>
1 Reported-by: Qian Cai <cai@xxxxxxxxxx>>
1 Reported-by: Qian Cai <cai@xxxxxx> writes:
1 Reported-by: kernel test robot <lkp@xxxxxxxxx> for missing #include
1 Reported-by: "kernelci.org bot" <bot@xxxxxxxxxxxx>"
1 Reported-by: kbuild test robot <lkp@xxxxxxxxx>]
1 Reported-by: Bob Sanders <bob.sanders@xxxxxxx> and the LTP
testsuite
1 Cc: Wolfram Sang <wsa@xxxxxxxxxx>,
1 Cc: Valdis Kletnieks <valdis.kletnieks@xxxxxx>,
1 Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxxxxxxxx>,
1 CC: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>,
1 Cc: Sia, Jee Heng <jee.heng.sia@xxxxxxxxx>;
alsa-devel@xxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
clang-built-linux@xxxxxxxxxxxxxxxx; Nathan Chancellor
<natechancellor@xxxxxxxxx>
1 Cc: Robert Sesek <rsesek@xxxxxxxxxx>,
1 CC: Peter Zijlstra <peterz@xxxxxxxxxxxxx>,
1 Cc: Omar Sandoval <osandov@xxxxxx>,
1 Cc: Michael Neuling <mikey@xxxxxxxxxxx> <mikey@xxxxxxxxxxx>
1 Cc: Maxime Ripard <mripard@xxxxxxxxxx>,
1 Cc: "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>,
1 Cc: Mark Scott <mscott@xxxxxxxxxxxxxx>,
1 Cc: Mark Rutland <mark.rutland@xxxxxxx>.
1 Cc: Mark Rutland <mark.rutland@xxxxxxx>,
1 Cc: Mark Rutland <mark.rutland@xxxxxxx>,
1 Cc: Laurent Pinchart <Laurent.pinchart@xxxxxxxxxxxxxxxx>,
1 Cc: Kees Cook <keescook@xxxxxxxxxx>,
1 Cc: Jonas Karlman <jonas@xxxxxxxxx>,
1 Cc: Jernej Skrabec <jernej.skrabec@xxxxxxxx>,
1 Cc: Jason Wang <jasowang@xxxxxxxxxx>; Parav Pandit
<parav@xxxxxxxxxxxx>; virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx;
linux-kernel@xxxxxxxxxxxxxxx; kernel-janitors@xxxxxxxxxxxxxxx
1 Cc: Jann Horn <jannh@xxxxxxxxxx>,
1 Cc: James Bottomley <james.bottomley@xxxxxxxxxxxxxxxxxxxxx>,
1 Cc: Icenowy Zheng <icenowy@xxxxxxx>,
1 Cc: Dan Murphy <dmurphy@xxxxxx>A
1 Cc: Daniel Vetter <daniel@xxxxxxxx>,
1 Cc: Christoph Lameter <cl@xxxxxxxxx>Cc: Pekka Enberg
<penberg@xxxxxxxxxx>
1 Cc: Christoph Hellwig <hch@xxxxxx>,
1 Cc: Christian König <christian.koenig@xxxxxxx>.
1 CC: "Chang S. Bae" <chang.seok.bae@xxxxxxxxx>,
1 Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>e
1 Acked-by: Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>A
1 Acked-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>A
For cases with no closing '>', following cases were not
reported by checkpatch:
6 Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx,
1 Reviewed-by: Max Gurtovoy <maxg@xxxxxxxxxxxx
<mailto:maxg@xxxxxxxxxxxx>>
1 Cc: rostedt@xxxxxxxxxxx,
1 Cc: linux-wireless@xxxxxxxxxxxxxxx,
1 Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx,
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.