Git development
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Pete Harlan <pgit@pcharlan.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>, git <git@vger.kernel.org>
Subject: [PATCH V2] git-send-email.perl: Deduplicate "to:" and "cc:" entries with names
Date: Sat, 20 Nov 2010 15:06:05 -0800	[thread overview]
Message-ID: <1290294365.31117.40.camel@Joe-Laptop> (raw)
In-Reply-To: <4CE84FF3.2070906@pcharlan.com>

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>
---
V2: Added quote escaping suggested by Andreas Schwab

 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 $_ || $_ =~ /<\Q${cc}\E>$/ } @recipients
 		    }
 	       map { sanitize_address($_) }
 	       @cc);

  reply	other threads:[~2010-11-20 23:06 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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       ` Joe Perches [this message]
2010-11-26 18:34         ` [PATCH V2] " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1290294365.31117.40.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=git@vger.kernel.org \
    --cc=pgit@pcharlan.com \
    --cc=schwab@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox