path: root/git-send-email.perl
diff options
authorBaruch Siach <>2019-03-16 19:26:50 (GMT)
committerJunio C Hamano <>2019-04-04 09:50:03 (GMT)
commit9c545816befc7b38e7347beb85fab64840bd0a8f (patch)
treeee23f81b9db879da9033af9e9c8f4d7628a506e5 /git-send-email.perl
parent041f5ea1cf987a4068ef5f39ba0a09be85952064 (diff)
send-email: don't cc *-by lines with '-' prefix
Since commit ef0cc1df90f6b ("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 <> Signed-off-by: Baruch Siach <> Acked-by: Rasmus Villemoes <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'git-send-email.perl')
1 files changed, 1 insertions, 1 deletions
diff --git a/git-send-email.perl b/git-send-email.perl
index 8200d58..62c8f91 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1699,7 +1699,7 @@ sub process_file {
# Now parse the message body
while(<$fh>) {
$message .= $_;
- if (/^([a-z-]*-by|Cc): (.*)/i) {
+ if (/^([a-z][a-z-]*-by|Cc): (.*)/i) {
my ($what, $c) = ($1, $2);
# strip garbage for the address we'll use: