Skip to content

Commit fb34fe6

Browse files
Villemoesgitster
authored andcommitted
send-email: only consider lines containing @ or <> for automatic Cc'ing
While the address sanitizations routines do accept local addresses, that is almost never what is meant in a Cc or Signed-off-by trailer. Looking through all the signed-off-by lines in the linux kernel tree without a @, there are mostly two patterns: Either just a full name, or a full name followed by <user at domain.com> (i.e., with the word at instead of a @), and minor variations. For cc lines, the same patterns appear, along with lots of "cc stable" variations that do not actually name [email protected] Cc: stable # introduced pre-git times cc: stable.kernel.org In the <user at domain.com> cases, one gets a chance to interactively fix it. But when there is no <> pair, it seems we end up just using the first word as a (local) address. As the number of cases where a local address really was meant is likely (and anecdotally) quite small compared to the number of cases where we end up cc'ing a garbage address, insist on at least a @ or a <> pair being present. This is also preparation for the next patch, where we are likely to encounter even more non-addresses in -by lines, such as Reported-by: Coverity Patch-generated-by: Coccinelle Signed-off-by: Rasmus Villemoes <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent af249bf commit fb34fe6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

git-send-email.perl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,11 @@ sub process_file {
16941694
next if $suppress_cc{'sob'} and $what =~ /Signed-off-by/i;
16951695
next if $suppress_cc{'bodycc'} and $what =~ /Cc/i;
16961696
}
1697+
if ($c !~ /.+@.+|<.+>/) {
1698+
printf("(body) Ignoring %s from line '%s'\n",
1699+
$what, $_) unless $quiet;
1700+
next;
1701+
}
16971702
push @cc, $c;
16981703
printf(__("(body) Adding cc: %s from line '%s'\n"),
16991704
$c, $_) unless $quiet;

0 commit comments

Comments
 (0)