git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-send-email.perl: Deduplicate "to:" and "cc:" entries with names
@ 2010-11-20 17:06 Joe Perches
  2010-11-20 20:15 ` Andreas Schwab
  0 siblings, 1 reply; 13+ messages in thread
From: Joe Perches @ 2010-11-20 17:06 UTC (permalink / raw)
  To: git

If an email address in the "to:" list is in the style
"First Last <email@domain.tld>", ie: not just a bare
address like "email@domain.tld", and the same named
entry style exists in the "cc:" list, the current
logic will not remove the entry from the "cc:" list.

Add logic to better deduplicate the "cc:" list by also
matching the email address with angle brackets.

Signed-off-by: Joe Perches <joe@perches.com>
---
 git-send-email.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index f68ed5a..1ae5fbf 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -960,7 +960,7 @@ sub maildomain {
 sub send_message {
 	my @recipients = unique_email_list(@to);
 	@cc = (grep { my $cc = extract_valid_address($_);
-		      not grep { $cc eq $_ } @recipients
+		      not grep { $cc eq $_ || $_ =~ /<${cc}>$/ } @recipients
 		    }
 	       map { sanitize_address($_) }
 	       @cc);

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-02-06 20:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-20 17:06 [PATCH] git-send-email.perl: Deduplicate "to:" and "cc:" entries with names Joe Perches
2010-11-20 20:15 ` Andreas Schwab
2010-11-20 21:01   ` Joe Perches
2010-11-20 22:47     ` Pete Harlan
2010-11-20 23:06       ` [PATCH V2] " Joe Perches
2010-11-26 18:34         ` Junio C Hamano
2010-11-26 21:34           ` Joe Perches
2010-11-27  0:25             ` Junio C Hamano
2010-11-27  0:39               ` Joe Perches
2011-02-05 23:40               ` [PATCH] git-send-email.perl: Add --suppress-to Joe Perches
2011-02-06 20:28                 ` Junio C Hamano
2010-11-20 22:57     ` [PATCH] git-send-email.perl: Deduplicate "to:" and "cc:" entries with names Andreas Schwab
2010-11-20 23:00       ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).