git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-send-email.perl: Deduplicate "to:" and "cc:" entries with names

From
Joe Perches <joe@perches.com>
Date
Nov 20, 2010, 17:06 UTC
Message-ID
<1290272809.27951.30.camel@Joe-Laptop>

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);
Next: Andreas Schwab
Message 1 of 13 in “git-send-email.perl: Deduplicate "to:" and "cc:" entries with names”
  1. git-send-email.perl: Deduplicate "to:" and "cc:" entries with namesJoe Perches, Nov 20, 2010
  2. Andreas SchwabNov 20, 2010
  3. Joe PerchesNov 20, 2010
  4. Pete HarlanNov 20, 2010
  5. git-send-email.perl: Deduplicate "to:" and "cc:" entries with namesJoe Perches, Nov 20, 2010
  6. Junio C HamanoNov 26, 2010
  7. Joe PerchesNov 26, 2010
  8. Junio C HamanoNov 27, 2010
  9. Joe PerchesNov 27, 2010
  10. git-send-email.perl: Add --suppress-toJoe Perches, Feb 5, 2011
  11. Junio C HamanoFeb 6, 2011
  12. Andreas SchwabNov 20, 2010
  13. Joe PerchesNov 20, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.