{"thread":{"id":"1401","subject":"[PATCH 1/2] git-send-email-script - Fix loops that limit emails to unique values to be pedantically correct.","startedAt":"2005-08-03T01:45:22Z","lastAt":"2005-08-03T01:45:22Z","messageCount":2,"participants":["Ryan Anderson"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"6737","messageId":"1123033522656-git-send-email-ryan@michonline.com","threadId":"1401","inReplyTo":null,"subject":"[PATCH 1/2] git-send-email-script - Fix loops that limit emails to unique values to be pedantically correct.","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2005-08-03T01:45:22Z","receivedAt":"2005-08-03T01:45:22Z","isPatch":true,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"Email addresses aren't generally case sensitive in the real world, but\ntechnically, they *can* be.  So, let's do the right thing.\n\nAdditionally, fix the generated message-id to have the right template used.\n\nSigned-off-by: Ryan Anderson <ryan@michonline.com>\n---\n\n git-send-email-script |   35 ++++++++++++++++++++++++-----------\n 1 files changed, 24 insertions(+), 11 deletions(-)\n\n8e791ded8877746b82432f2b53f871197a3c3901\ndiff --git a/git-send-email-script b/git-send-email-script\n--- a/git-send-email-script\n+++ b/git-send-email-script\n@@ -24,6 +24,8 @@ use Getopt::Long;\n use Data::Dumper;\n use Email::Valid;\n \n+sub unique_email_list(@);\n+\n # Variables we fill in automatically, or via prompting:\n my (@to,@cc,$initial_reply_to,$initial_subject,@files,$from);\n \n@@ -138,8 +140,9 @@ Options:\n    --to\t          Specify the primary \"To:\" line of the email.\n    --subject      Specify the initial \"Subject:\" line.\n    --in-reply-to  Specify the first \"In-Reply-To:\" header line.\n-   --chain-reply-to If set, the replies will all be to the first\n-   \t\t  email sent, rather than to the last email sent.\n+   --chain-reply-to If set, the replies will all be to the previous\n+   \t\t  email sent, rather than to the first email sent.\n+\t\t  Defaults to on.\n    --smtp-server  If set, specifies the outgoing SMTP server to use.\n                   Defaults to localhost.\n \n@@ -161,7 +164,7 @@ our ($message_id, $cc, %mail, $subject, \n \n # We'll setup a template for the message id, using the \"from\" address:\n my $message_id_from = Email::Valid->address($from);\n-my $message_id_template = \"<%s-git-send-email-$from>\";\n+my $message_id_template = \"<%s-git-send-email-$message_id_from>\";\n \n sub make_message_id\n {\n@@ -178,10 +181,7 @@ $cc = \"\";\n \n sub send_message\n {\n-\tmy %to;\n-\t$to{lc(Email::Valid->address($_))}++ for (@to);\n-\n-\tmy $to = join(\",\", keys %to);\n+\tmy $to = join (\", \", unique_email_list(@to));\n \n \t%mail = (\tTo\t=>\t$to,\n \t\t\tFrom\t=>\t$from,\n@@ -267,10 +267,7 @@ foreach my $t (@files) {\n \t}\n \tclose F;\n \n-\tmy %clean_ccs;\n-\t$clean_ccs{lc(Email::Valid->address($_))}++ for @cc;\n-\n-\t$cc = join(\",\", keys %clean_ccs);\n+\t$cc = join(\", \", unique_email_list(@cc));\n \n \tsend_message();\n \n@@ -281,3 +278,19 @@ foreach my $t (@files) {\n \tmake_message_id();\n #\t$subject = \"Re: \".$initial_subject;\n }\n+\n+\n+sub unique_email_list(@) {\n+\tmy %seen;\n+\tmy @emails;\n+\n+\tforeach my $entry (@_) {\n+\t\tmy $clean = Email::Valid->address($entry);\n+\t\tnext if $seen{$clean}++;\n+\t\tpush @emails, $entry;\n+\t}\n+\treturn @emails;\n+}\n+\n+\n+\n"},{"id":"6738","messageId":"11230335222661-git-send-email-ryan@michonline.com","threadId":"1401","inReplyTo":"1123033522656-git-send-email-ryan@michonline.com","subject":"[PATCH 2/2] Doc: update git-send-email-script documentation.","fromName":"Ryan Anderson","fromEmail":"ryan@michonline.com","sentAt":"2005-08-03T01:45:22Z","receivedAt":"2005-08-03T01:45:22Z","isPatch":true,"sender":{"key":"ryan@michonline.com","avatar":null},"body":"Signed-off-by: Ryan Anderson <ryan@michonline.com>\n---\n\n Documentation/git-send-email-script.txt |   13 +++++++++++++\n 1 files changed, 13 insertions(+), 0 deletions(-)\n\nb09788cd193a52bb44ab39826c9c6959f79305d5\ndiff --git a/Documentation/git-send-email-script.txt b/Documentation/git-send-email-script.txt\n--- a/Documentation/git-send-email-script.txt\n+++ b/Documentation/git-send-email-script.txt\n@@ -44,6 +44,19 @@ The options available are:\n \tto set this to a space.  For example\n \t\t--in-reply-to=\" \"\n \n+   --chain-reply-to, --no-chain-reply-to\n+\tIf this is set, each email will be sent as a reply to the previous\n+\temail sent.  If disabled with \"--no-chain-reply-to\", all emails after\n+\tthe first will be sent as replies to the first email sent.  When using\n+\tthis, it is recommended that the first file given be an overview of the\n+\tentire patch series.\n+\tDefault is --chain-reply-to\n+\n+   --smtp-server\n+\tIf set, specifies the outgoing SMTP server to use.  Defaults to\n+\tlocalhost.\n+\n+\n Author\n ------\n Written by Ryan Anderson <ryan@michonline.com>\n"}]}