threads / patch / 10942

patchgit-send-email: Don't add To: recipients to the Cc: header too

Subject: [PATCH] git-send-email: Don't add To: recipients to the Cc: header too

## tl;dr

One message between Nov 20, 2007 and Nov 20, 2007. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Ask Bjørn Hansen· Nov 20, 2007, 09:34 UTC · lore
Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
---
 git-send-email.perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
Show changes to git-send-email.perl +5 −1
diff --git a/git-send-email.perl b/git-send-email.perl
index fd0a4ad..b832d2d 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -557,7 +557,11 @@ sub sanitize_address
 sub send_message
 {
 	my @recipients = unique_email_list(@to);
-	@cc = (map { sanitize_address($_) } @cc);
+	@cc = (grep { my $cc = extract_valid_address($_);
+		      not grep { $cc eq $_ } @recipients
+		    }
+	       map { sanitize_address($_) }
+	       @cc);
 	my $to = join (",\n\t", @recipients);
 	@recipients = unique_email_list(@recipients,@cc,@bcclist);
 	@recipients = (map { extract_valid_address($_) } @recipients);
-- 
1.5.3.5.561.g140d

← back to recent threads