Skip to content

Commit 9c54581

Browse files
baruchsiachgitster
authored andcommitted
send-email: don't cc *-by lines with '-' prefix
Since commit ef0cc1d ("send-email: also pick up cc addresses from -by trailers") in git version 2.20, git send-email adds to cc list addresses from all *-by lines. As a side effect a line with '-Signed-off-by' is now also added to cc. This makes send-email pick lines from patches that remove patch files from the git repo. This is common in the Buildroot project that often removes (and adds) patch files that have 'Signed-off-by' in their patch description part. Consider only *-by lines that start with [a-z] (case insensitive) to avoid unrelated addresses in cc. Cc: Joe Perches <[email protected]> Signed-off-by: Baruch Siach <[email protected]> Acked-by: Rasmus Villemoes <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 041f5ea commit 9c54581

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-send-email.perl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1699,7 +1699,7 @@ sub process_file {
16991699
# Now parse the message body
17001700
while(<$fh>) {
17011701
$message .= $_;
1702-
if (/^([a-z-]*-by|Cc): (.*)/i) {
1702+
if (/^([a-z][a-z-]*-by|Cc): (.*)/i) {
17031703
chomp;
17041704
my ($what, $c) = ($1, $2);
17051705
# strip garbage for the address we'll use:

0 commit comments

Comments
 (0)