Skip to contentSkip to conversation

scripts/checkpatch: Improve the check for authors mangled by the mailing list

PATCH In review Thomas Huth 3 participants 3 messages Feb 16, 2021 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/checkpatch: Improve the check for authors mangled by the mailing list

There were recently some patches on the list which had their "From:" line mangled like this:

From: qemu_oss--- via <[email protected]>

Since our test in the checkpatch.pl script did not trigger here, the patches finally also ended up in a pull request, with the wrong author set. So let's improve the regular expression to also complain on these new patterns, too.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index e47ad878d8..7f194c842b 100755
@@ -1499,7 +1499,7 @@ sub process {
 			$is_patch = 1;
 		}
 
-		if ($line =~ /^Author: .*via Qemu-devel.*<qemu-devel\@nongnu.org>/) {
+		if ($line =~ /^(Author|From): .* via .*<qemu-devel\@nongnu.org>/) {
 		    ERROR("Author email address is mangled by the mailing list\n" . $herecurr);
 		}
 
Signature · 1 line
2.27.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 9 lines · Thomas Huth

There were recently some patches on the list which had their "From:" line mangled like this:

From: qemu_oss--- via <[email protected]>

Since our test in the checkpatch.pl script did not trigger here, the patches finally also ended up in a pull request, with the wrong author set. So let's improve the regular expression to also complain on these new patterns, too.

:(

Quoted 5 lines
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Huth
Quoted 20 lines · On Dienstag, 16. Februar 2021 08:15:12 CET Thomas Huth wrote:

There were recently some patches on the list which had their "From:" line mangled like this:

From: qemu_oss--- via <[email protected]>

Since our test in the checkpatch.pl script did not trigger here, the patches finally also ended up in a pull request, with the wrong author set. So let's improve the regular expression to also complain on these new patterns, too.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +0 -0
index e47ad878d8..7f194c842b 100755

scripts/checkpatch.pl sub process { · line 1504

Quoted 7 lines
scripts/checkpatch.pl +1 -1
@@ -1499,7 +1499,7 @@ sub process {
 			$is_patch = 1;
 		}
 
-		if ($line =~ /^Author: .*via Qemu-devel.*<qemu-devel\@nongnu.org>/) {
+		if ($line =~ /^(Author|From): .* via .*<qemu-devel\@nongnu.org>/) {
 		    ERROR("Author email address is mangled by the mailing list\n" .
 $herecurr); }

I would probably generalize the pattern even a bit more:

		if ($line =~ /^(Author|From): .*<qemu-devel\@nongnu.org>/) {

Because mailman's precise sender-rewrite prefix changed couple times. But for now the change above will do as well of course.

Best regards,
Christian Schoenebeck