{"thread":{"id":"18770","subject":"[PATCH RFC 1/6] send-email: Add --delay for separating emails","startedAt":"2009-04-07T21:25:17Z","lastAt":"2009-04-12T02:36:48Z","messageCount":30,"participants":["Michael Witten","demerphq","Jeff King","Nicolas Sebrecht","Andreas Ericsson","Junio C Hamano","Tomas Carnecky","Wesley J. Landaker"],"isPatch":true,"patchVersion":1,"patchTotal":6},"messages":[{"id":"110737","messageId":"1239139522-24118-1-git-send-email-mfwitten@gmail.com","threadId":"18770","inReplyTo":null,"subject":"[PATCH RFC 1/6] send-email: Add --delay for separating emails","fromName":"Michael Witten","fromEmail":"mfwitten@gmail.com","sentAt":"2009-04-07T21:25:17Z","receivedAt":"2009-04-07T21:25:17Z","isPatch":true,"sender":{"key":"mfwitten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/597101?v=4"},"body":"When sending a patch series, the emails often arrive at the final\ndestination out of order; though these emails should be chained\nvia the In-Reply-To headers, some mail-viewing systems display\nby order of arrival instead.\n\nThe --delay option provides a means for specifying that there\nshould be a certain number of seconds of delay between sending\nemails, so that the arrival order can be controlled better.\n\nSigned-off-by: Michael Witten <mfwitten@gmail.com>\n---\n Documentation/git-send-email.txt |    5 +++++\n git-send-email.perl              |   17 +++++++++++++----\n 2 files changed, 18 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 10dfd66..4b656ca 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -97,6 +97,11 @@ The --to option must be repeated for each user you want on the to list.\n Sending\n ~~~~~~~\n \n+--delay::\n+\tSpecify the minimum number of seconds of delay that should occur\n+\tbetween sending emails. This number should be an integer >= zero.\n+\tDefault is the value of the 'sendemail.delay' configuration variable.\n+\n --envelope-sender::\n \tSpecify the envelope sender used to send the emails.\n \tThis is useful if your default address is not the address that is\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 172b53c..273c8c7 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -56,6 +56,7 @@ git send-email [options] <file | directory | rev-list options >\n     --compose                      * Open an editor for introduction.\n \n   Sending:\n+    --delay                 <int>  * Delay (seconds) between sending emails.\n     --envelope-sender       <str>  * Email envelope sender.\n     --smtp-server       <str:int>  * Outgoing SMTP server to use. The port\n                                      is optional. Default 'localhost'.\n@@ -180,7 +181,7 @@ sub do_edit {\n }\n \n # Variables with corresponding config settings\n-my ($thread, $chain_reply_to, $suppress_from, $signed_off_by_cc, $cc_cmd);\n+my ($delay, $thread, $chain_reply_to, $suppress_from, $signed_off_by_cc, $cc_cmd);\n my ($smtp_server, $smtp_server_port, $smtp_authuser, $smtp_encryption);\n my ($identity, $aliasfiletype, @alias_files, @smtp_host_parts);\n my ($validate, $confirm);\n@@ -196,6 +197,7 @@ my %config_bool_settings = (\n );\n \n my %config_settings = (\n+    \"delay\" => \\$delay,\n     \"smtpserver\" => \\$smtp_server,\n     \"smtpserverport\" => \\$smtp_server_port,\n     \"smtpuser\" => \\$smtp_authuser,\n@@ -247,6 +249,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n \t\t    \"cc=s\" => \\@initial_cc,\n \t\t    \"bcc=s\" => \\@bcclist,\n \t\t    \"chain-reply-to!\" => \\$chain_reply_to,\n+\t\t    \"delay=i\" => \\$delay,\n \t\t    \"smtp-server=s\" => \\$smtp_server,\n \t\t    \"smtp-server-port=s\" => \\$smtp_server_port,\n \t\t    \"smtp-user=s\" => \\$smtp_authuser,\n@@ -973,8 +976,9 @@ $references = $initial_reply_to || '';\n $subject = $initial_subject;\n $message_num = 0;\n \n-foreach my $t (@files) {\n-\topen(F,\"<\",$t) or die \"can't open file $t\";\n+for (my $index = 0; $index < @files; $index++) {\n+\tmy $file = $files[$index];\n+\topen(F,\"<\",$file) or die \"can't open file $file\";\n \n \tmy $author = undef;\n \tmy $author_encoding;\n@@ -1083,7 +1087,7 @@ foreach my $t (@files) {\n \tclose F;\n \n \tif (defined $cc_cmd && !$suppress_cc{'cccmd'}) {\n-\t\topen(F, \"$cc_cmd $t |\")\n+\t\topen(F, \"$cc_cmd $file |\")\n \t\t\tor die \"(cc-cmd) Could not execute '$cc_cmd'\";\n \t\twhile(<F>) {\n \t\t\tmy $c = $_;\n@@ -1128,6 +1132,11 @@ foreach my $t (@files) {\n \n \tsend_message();\n \n+\tif ($delay && $index < $#files) {\n+\t\tmy $this_long = $delay;\n+\t\twhile (($this_long -= sleep $this_long) > 0) {}\n+\t}\n+\n \t# set up for the next message\n \tif ($chain_reply_to || !defined $reply_to || length($reply_to) == 0) {\n \t\t$reply_to = $message_id;\n-- \n1.6.2.2.448.g61445.dirty\n"},{"id":"110739","messageId":"1239139522-24118-2-git-send-email-mfwitten@gmail.com","threadId":"18770","inReplyTo":"1239139522-24118-1-git-send-email-mfwitten@gmail.com","subject":"[PATCH RFC 2/6] send-email: --smtp-server-port should take an integer","fromName":"Michael Witten","fromEmail":"mfwitten@gmail.com","sentAt":"2009-04-07T21:25:18Z","receivedAt":"2009-04-07T21:25:18Z","isPatch":true,"sender":{"key":"mfwitten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/597101?v=4"},"body":"Signed-off-by: Michael Witten <mfwitten@gmail.com>\n---\n git-send-email.perl |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 273c8c7..63d6063 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -251,7 +251,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n \t\t    \"chain-reply-to!\" => \\$chain_reply_to,\n \t\t    \"delay=i\" => \\$delay,\n \t\t    \"smtp-server=s\" => \\$smtp_server,\n-\t\t    \"smtp-server-port=s\" => \\$smtp_server_port,\n+\t\t    \"smtp-server-port=i\" => \\$smtp_server_port,\n \t\t    \"smtp-user=s\" => \\$smtp_authuser,\n \t\t    \"smtp-pass:s\" => \\$smtp_authpass,\n \t\t    \"smtp-ssl\" => sub { $smtp_encryption = 'ssl' },\n-- \n1.6.2.2.448.g61445.dirty\n"},{"id":"110740","messageId":"1239139522-24118-3-git-send-email-mfwitten@gmail.com","threadId":"18770","inReplyTo":"1239139522-24118-2-git-send-email-mfwitten@gmail.com","subject":"[PATCH RFC 3/6] send-email: Handle \"GIT:\" rather than \"GIT: \" during --compose","fromName":"Michael Witten","fromEmail":"mfwitten@gmail.com","sentAt":"2009-04-07T21:25:19Z","receivedAt":"2009-04-07T21:25:19Z","isPatch":true,"sender":{"key":"mfwitten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/597101?v=4"},"body":"This should make things a little more robust in terms of user input;\nbefore, even the program got it wrong by outputting a line with only\n\"GIT:\", which was left in place as a header, because there would be\nno following space character.\n\nAlso, I cleaned up get_patch_subject().\n\nSigned-off-by: Michael Witten <mfwitten@gmail.com>\n---\n git-send-email.perl |   23 ++++++++++++-----------\n 1 files changed, 12 insertions(+), 11 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 63d6063..098c620 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -505,15 +505,16 @@ if (@files) {\n }\n \n sub get_patch_subject($) {\n-\tmy $fn = shift;\n-\topen (my $fh, '<', $fn);\n-\twhile (my $line = <$fh>) {\n-\t\tnext unless ($line =~ /^Subject: (.*)$/);\n-\t\tclose $fh;\n-\t\treturn \"GIT: $1\\n\";\n+\n+\tmy $patch = shift;\n+\topen (my $fh, '<', $patch);\n+\n+\twhile (<$fh>) {\n+\t\tnext unless (/^Subject: (.*)$/);\n+\t\treturn $1;\n \t}\n-\tclose $fh;\n-\tdie \"No subject line in $fn ?\";\n+\n+\tdie \"'Subject:' line expected in '$patch'\";\n }\n \n if ($compose) {\n@@ -532,7 +533,7 @@ if ($compose) {\n \n \tprint C <<EOT;\n From $tpl_sender # This line is ignored.\n-GIT: Lines beginning in \"GIT: \" will be removed.\n+GIT: Lines beginning in \"GIT:\" will be removed.\n GIT: Consider including an overall diffstat or table of contents\n GIT: for the patch you are writing.\n GIT:\n@@ -543,7 +544,7 @@ In-Reply-To: $tpl_reply_to\n \n EOT\n \tfor my $f (@files) {\n-\t\tprint C get_patch_subject($f);\n+\t\tprint C \"GIT: \", get_patch_subject($f), \"\\n\";\n \t}\n \tclose(C);\n \n@@ -565,7 +566,7 @@ EOT\n \tmy $in_body = 0;\n \tmy $summary_empty = 1;\n \twhile(<C>) {\n-\t\tnext if m/^GIT: /;\n+\t\tnext if m/^GIT:/;\n \t\tif ($in_body) {\n \t\t\t$summary_empty = 0 unless (/^\\n$/);\n \t\t} elsif (/^\\n$/) {\n-- \n1.6.2.2.448.g61445.dirty\n"},{"id":"110738","messageId":"1239139522-24118-4-git-send-email-mfwitten@gmail.com","threadId":"18770","inReplyTo":"1239139522-24118-3-git-send-email-mfwitten@gmail.com","subject":"[PATCH RFC 4/6] send-email: --compose takes optional argument to existing file","fromName":"Michael Witten","fromEmail":"mfwitten@gmail.com","sentAt":"2009-04-07T21:25:20Z","receivedAt":"2009-04-07T21:25:20Z","isPatch":true,"sender":{"key":"mfwitten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/597101?v=4"},"body":"Now, a user may specify an existing (in-progress) file to use as\nthe introductory/summary email.\n\nThe file is opened for any additional editing as usual.\n\nSigned-off-by: Michael Witten <mfwitten@gmail.com>\n---\n Documentation/git-send-email.txt |    7 ++-\n git-send-email.perl              |  112 ++++++++++++++++++++++----------------\n 2 files changed, 71 insertions(+), 48 deletions(-)\n\ndiff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\nindex 4b656ca..bc9ff13 100644\n--- a/Documentation/git-send-email.txt\n+++ b/Documentation/git-send-email.txt\n@@ -57,8 +57,11 @@ The --cc option must be repeated for each user you want on the cc list.\n \tor one for all of them at once.\n \n --compose::\n-\tUse $GIT_EDITOR, core.editor, $VISUAL, or $EDITOR to edit an\n-\tintroductory message for the patch series.\n+\tUse $GIT_EDITOR, core.editor, $VISUAL, or $EDITOR, or vi to edit an\n+\tintroductory message for the patch series. An existing file may be\n+\tspecified as the basis for the introductory email; it will be opened\n+\tfor editing directly. Otherwise, a new temporary file is created with\n+\tsome default contents.\n +\n When '--compose' is used, git send-email will use the From, Subject, and\n In-Reply-To headers specified in the message. If the body of the message\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 098c620..481bf36 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -53,7 +53,7 @@ git send-email [options] <file | directory | rev-list options >\n     --subject               <str>  * Email \"Subject:\"\n     --in-reply-to           <str>  * Email \"In-Reply-To:\"\n     --annotate                     * Review each patch that will be sent in an editor.\n-    --compose                      * Open an editor for introduction.\n+    --compose           opt <str>  * Open an editor for introduction.\n \n   Sending:\n     --delay                 <int>  * Delay (seconds) between sending emails.\n@@ -62,7 +62,7 @@ git send-email [options] <file | directory | rev-list options >\n                                      is optional. Default 'localhost'.\n     --smtp-server-port      <int>  * Outgoing SMTP server port.\n     --smtp-user             <str>  * Username for SMTP-AUTH.\n-    --smtp-pass             <str>  * Password for SMTP-AUTH; not necessary.\n+    --smtp-pass         opt <str>  * Password for SMTP-AUTH; not necessary.\n     --smtp-encryption       <str>  * tls or ssl; anything else disables.\n     --smtp-ssl                     * Deprecated. Use '--smtp-encryption ssl'.\n \n@@ -159,7 +159,7 @@ if ($@) {\n # Behavior modification variables\n my ($quiet, $dry_run) = (0, 0);\n my $format_patch;\n-my $compose_filename;\n+my ($compose_filename, $compose_final_filename, $compose_final_is_not_empty);\n \n # Handle interactive edition of files.\n my $multiedit;\n@@ -224,13 +224,12 @@ sub signal_handler {\n \tsystem \"stty echo\";\n \n \t# tmp files from --compose\n-\tif (defined $compose_filename) {\n-\t\tif (-e $compose_filename) {\n-\t\t\tprint \"'$compose_filename' contains an intermediate version of the email you were composing.\\n\";\n-\t\t}\n-\t\tif (-e ($compose_filename . \".final\")) {\n-\t\t\tprint \"'$compose_filename.final' contains the composed email.\\n\"\n-\t\t}\n+\tif (defined $compose_filename and -f $compose_filename) {\n+\t\tprint \"'$compose_filename' contains an intermediate version of the email you were composing.\\n\";\n+\t}\n+\n+\tif (defined $compose_final_filename and -f $compose_final_filename) {\n+\t\tprint \"'$compose_final_filename' contains the composed email.\\n\"\n \t}\n \n \texit;\n@@ -258,7 +257,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n \t\t    \"smtp-encryption=s\" => \\$smtp_encryption,\n \t\t    \"identity=s\" => \\$identity,\n \t\t    \"annotate\" => \\$annotate,\n-\t\t    \"compose\" => \\$compose,\n+\t\t    \"compose:s\" => \\$compose,\n \t\t    \"quiet\" => \\$quiet,\n \t\t    \"cc-cmd=s\" => \\$cc_cmd,\n \t\t    \"suppress-from!\" => \\$suppress_from,\n@@ -517,21 +516,36 @@ sub get_patch_subject($) {\n \tdie \"'Subject:' line expected in '$patch'\";\n }\n \n-if ($compose) {\n-\t# Note that this does not need to be secure, but we will make a small\n-\t# effort to have it be unique\n-\t$compose_filename = ($repo ?\n-\t\ttempfile(\".gitsendemail.msg.XXXXXX\", DIR => $repo->repo_path()) :\n-\t\ttempfile(\".gitsendemail.msg.XXXXXX\", DIR => \".\"))[1];\n-\topen(C,\">\",$compose_filename)\n-\t\tor die \"Failed to open for writing $compose_filename: $!\";\n+if (defined $compose) {\n+\n+\tmy ($tmp_file, $tmp_filename) = tempfile(\".gitsendemail.msg.XXXXXX\", DIR => ($repo ? $repo->repo_path() : \".\"));\n \n+\tmy $compose_file;\n+\tmy $compose_final_file;\n+\n+\tif ($compose ne '') {\n+\n+\t\t$compose_filename = $compose;\n+\n+\t\t$compose_final_filename = $tmp_filename;\n+\t\t$compose_final_file     = $tmp_file\n+\n+\t} else {\n \n-\tmy $tpl_sender = $sender || $repoauthor || $repocommitter || '';\n-\tmy $tpl_subject = $initial_subject || '';\n-\tmy $tpl_reply_to = $initial_reply_to || '';\n+\t\t$compose_filename = $tmp_filename;\n+\t\t$compose_file     = $tmp_file;\n \n-\tprint C <<EOT;\n+\t\t$compose_final_filename = \"$compose_filename.final\";\n+\t\topen $compose_final_file, \">\", $compose_final_filename\n+\t\t\tor die \"Failed to open '$compose_final_filename' for writing: $!\";\n+\n+\t\t# Help the user out with some instruction and initial headers:\n+\n+\t\tmy $tpl_sender = $sender || $repoauthor || $repocommitter || '';\n+\t\tmy $tpl_subject = $initial_subject || '';\n+\t\tmy $tpl_reply_to = $initial_reply_to || '';\n+\n+\t\tprint $compose_file <<EOT;\n From $tpl_sender # This line is ignored.\n GIT: Lines beginning in \"GIT:\" will be removed.\n GIT: Consider including an overall diffstat or table of contents\n@@ -543,10 +557,10 @@ Subject: $tpl_subject\n In-Reply-To: $tpl_reply_to\n \n EOT\n-\tfor my $f (@files) {\n-\t\tprint C \"GIT: \", get_patch_subject($f), \"\\n\";\n+\t\tfor my $f (@files) {\n+\t\t\tprint $compose_file \"GIT: \", get_patch_subject($f), \"\\n\";\n+\t\t}\n \t}\n-\tclose(C);\n \n \tmy $editor = $ENV{GIT_EDITOR} || Git::config(@repo, \"core.editor\") || $ENV{VISUAL} || $ENV{EDITOR} || \"vi\";\n \n@@ -556,23 +570,28 @@ EOT\n \t\tdo_edit($compose_filename);\n \t}\n \n-\topen(C2,\">\",$compose_filename . \".final\")\n-\t\tor die \"Failed to open $compose_filename.final : \" . $!;\n+\t# Now transform the user-edited introduction into something\n+\t# suitable for sending via email; the user's editor may have\n+\t# unlinked the original file and replaced it with an entirely\n+\t# new one. If this be the case, then it wouldn't do just to\n+\t# seek to the beginning and start reading, because then only\n+\t# the original content would be retrieved. Consequently, the\n+\t# file must be reopened to be safe (note, the original\n+\t# filehandle is closed automatically).\n \n-\topen(C,\"<\",$compose_filename)\n-\t\tor die \"Failed to open $compose_filename : \" . $!;\n+\topen $compose_file, \"<\", $compose_filename\n+\t\tor die \"Failed to open '$compose_filename' for reading: $!\";\n \n \tmy $need_8bit_cte = file_has_nonascii($compose_filename);\n \tmy $in_body = 0;\n-\tmy $summary_empty = 1;\n-\twhile(<C>) {\n+\twhile(<$compose_file>) {\n \t\tnext if m/^GIT:/;\n-\t\tif ($in_body) {\n-\t\t\t$summary_empty = 0 unless (/^\\n$/);\n+\t\tif ($in_body && not /^\\n$/) {\n+\t\t\t $compose_final_is_not_empty = 1;\n \t\t} elsif (/^\\n$/) {\n \t\t\t$in_body = 1;\n \t\t\tif ($need_8bit_cte) {\n-\t\t\t\tprint C2 \"MIME-Version: 1.0\\n\",\n+\t\t\t\tprint $compose_final_file \"MIME-Version: 1.0\\n\",\n \t\t\t\t\t \"Content-Type: text/plain; \",\n \t\t\t\t\t   \"charset=utf-8\\n\",\n \t\t\t\t\t \"Content-Transfer-Encoding: 8bit\\n\";\n@@ -597,15 +616,12 @@ EOT\n \t\t\tprint \"To/Cc/Bcc fields are not interpreted yet, they have been ignored\\n\";\n \t\t\tnext;\n \t\t}\n-\t\tprint C2 $_;\n-\t}\n-\tclose(C);\n-\tclose(C2);\n \n-\tif ($summary_empty) {\n-\t\tprint \"Summary email is empty, skipping it\\n\";\n-\t\t$compose = -1;\n+\t\tprint $compose_final_file $_;\n \t}\n+\n+\tprint \"Summary email is empty, skipping it\\n\" unless ($compose_final_is_not_empty);\n+\n } elsif ($annotate) {\n \tdo_edit(@files);\n }\n@@ -685,9 +701,7 @@ if (!defined $smtp_server) {\n \t$smtp_server ||= 'localhost'; # could be 127.0.0.1, too... *shrug*\n }\n \n-if ($compose && $compose > 0) {\n-\t@files = ($compose_filename . \".final\", @files);\n-}\n+unshift(@files, $compose_final_filename) if ($compose_final_is_not_empty);\n \n # Variables we set as part of the loop over files\n our ($message_id, %mail, $subject, $reply_to, $references, $message,\n@@ -1153,7 +1167,13 @@ for (my $index = 0; $index < @files; $index++) {\n cleanup_compose_files();\n \n sub cleanup_compose_files() {\n-\tunlink($compose_filename, $compose_filename . \".final\") if $compose;\n+\tif (defined $compose) {\n+\t\tunlink(\n+\t\t\t$compose_final_filename,\n+\t\t\t# Don't delete user-supplied file.\n+\t\t\t$compose ? () : $compose_filename\n+\t\t);\n+\t}\n }\n \n $smtp->quit if $smtp;\n-- \n1.6.2.2.448.g61445.dirty\n"},{"id":"110741","messageId":"1239139522-24118-5-git-send-email-mfwitten@gmail.com","threadId":"18770","inReplyTo":"1239139522-24118-4-git-send-email-mfwitten@gmail.com","subject":"[PATCH RFC 5/6] send-email: Cleanup the usage text a bit","fromName":"Michael Witten","fromEmail":"mfwitten@gmail.com","sentAt":"2009-04-07T21:25:21Z","receivedAt":"2009-04-07T21:25:21Z","isPatch":true,"sender":{"key":"mfwitten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/597101?v=4"},"body":"All lines should be < 80 characters.\n\nSigned-off-by: Michael Witten <mfwitten@gmail.com>\n---\n git-send-email.perl |   16 +++++++++++-----\n 1 files changed, 11 insertions(+), 5 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex 481bf36..c3e3598 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -42,6 +42,9 @@ package main;\n \n \n sub usage {\n+\n+\t# All printed lines should be less than 80 characters.\n+\n \tprint <<EOT;\n git send-email [options] <file | directory | rev-list options >\n \n@@ -52,7 +55,8 @@ git send-email [options] <file | directory | rev-list options >\n     --bcc                   <str>  * Email Bcc:\n     --subject               <str>  * Email \"Subject:\"\n     --in-reply-to           <str>  * Email \"In-Reply-To:\"\n-    --annotate                     * Review each patch that will be sent in an editor.\n+    --annotate                     * Review each patch that will be sent in\n+                                     an editor.\n     --compose           opt <str>  * Open an editor for introduction.\n \n   Sending:\n@@ -69,8 +73,10 @@ git send-email [options] <file | directory | rev-list options >\n   Automating:\n     --identity              <str>  * Use the sendemail.<id> options.\n     --cc-cmd                <str>  * Email Cc: via `<str> \\$patch_path`\n-    --suppress-cc           <str>  * author, self, sob, cc, cccmd, body, bodycc, all.\n-    --[no-]signed-off-by-cc        * Send to Signed-off-by: addresses. Default on.\n+    --suppress-cc           <str>  * author, self, sob, cc, cccmd, body,\n+                                     bodycc, all.\n+    --[no-]signed-off-by-cc        * Send to Signed-off-by: addresses.\n+                                     Default on.\n     --[no-]suppress-from           * Send to self. Default off.\n     --[no-]chain-reply-to          * Chain In-Reply-To: fields. Default on.\n     --[no-]thread                  * Use In-Reply-To: field. Default on.\n@@ -81,8 +87,8 @@ git send-email [options] <file | directory | rev-list options >\n     --quiet                        * Output one line of info per email.\n     --dry-run                      * Don't actually send the emails.\n     --[no-]validate                * Perform patch sanity checks. Default on.\n-    --[no-]format-patch            * understand any non optional arguments as\n-                                     `git format-patch` ones.\n+    --[no-]format-patch            * Understand any non-optional arguments as\n+                                     `git format-patch' arguments.\n \n EOT\n \texit(1);\n-- \n1.6.2.2.448.g61445.dirty\n"},{"id":"110742","messageId":"1239139522-24118-6-git-send-email-mfwitten@gmail.com","threadId":"18770","inReplyTo":"1239139522-24118-5-git-send-email-mfwitten@gmail.com","subject":"[PATCH RFC 6/6] send-email: Remove horrible mix of tabs and spaces","fromName":"Michael Witten","fromEmail":"mfwitten@gmail.com","sentAt":"2009-04-07T21:25:22Z","receivedAt":"2009-04-07T21:25:22Z","isPatch":true,"sender":{"key":"mfwitten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/597101?v=4"},"body":"For the most part, I ran a search for all the lines\nthat match:\n\n    ^[\\t]*[ ]+\n\nand then I manually replaced the offending text with\nan appropriate number of tabs.\n\nWhile scanning through the file, I also tried to format\nsome of the code so as to obviate future mixing; I also\nfixed one horrendously egregious section of code, where\nsomeone was trying to be unnecessarily compact.\n\nCurrently, no lines match the following:\n\n    [\\t]+[ ]+\n    [ ]+[\\t]+\n\nSo, it should be reasonably clean.\n\nThe whole file is still horrendous.\n\nSigned-off-by: Michael Witten <mfwitten@gmail.com>\n---\n git-send-email.perl |  282 +++++++++++++++++++++++++++++++--------------------\n 1 files changed, 170 insertions(+), 112 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex c3e3598..a4c24f3 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -16,6 +16,14 @@\n #    and second line is the subject of the message.\n #\n \n+## WARNING! ACHTUNG! ATTENTION! ADVERTENCIA!\n+##   Currently, this file uses tabs (like the rest of git source) to\n+##   delineate code structure. Do NOT under any circumstances mix tabs\n+##   and spaces across lines that share a relationship in terms of layout.\n+##   In fact, it would currently be best to use only tabs, so please set\n+##   your editor(s) accordingly. This code is already trashy enough. Please\n+##   don't make it worse.\n+\n use strict;\n use warnings;\n use Term::ReadLine;\n@@ -118,19 +126,20 @@ sub format_2822_time {\n \t\tdie (\"local time offset greater than or equal to 24 hours\\n\");\n \t}\n \n-\treturn sprintf(\"%s, %2d %s %d %02d:%02d:%02d %s%02d%02d\",\n-\t\t       qw(Sun Mon Tue Wed Thu Fri Sat)[$localtm[6]],\n-\t\t       $localtm[3],\n-\t\t       qw(Jan Feb Mar Apr May Jun\n-\t\t\t  Jul Aug Sep Oct Nov Dec)[$localtm[4]],\n-\t\t       $localtm[5]+1900,\n-\t\t       $localtm[2],\n-\t\t       $localtm[1],\n-\t\t       $localtm[0],\n-\t\t       ($offset >= 0) ? '+' : '-',\n-\t\t       abs($offhour),\n-\t\t       $offmin,\n-\t\t       );\n+\treturn sprintf(\n+\t\t\"%s, %2d %s %d %02d:%02d:%02d %s%02d%02d\",\n+\t\tqw(Sun Mon Tue Wed Thu Fri Sat)[$localtm[6]],\n+\t\t$localtm[3],\n+\t\tqw(Jan Feb Mar Apr May Jun\n+\t\tJul Aug Sep Oct Nov Dec)[$localtm[4]],\n+\t\t$localtm[5]+1900,\n+\t\t$localtm[2],\n+\t\t$localtm[1],\n+\t\t$localtm[0],\n+\t\t($offset >= 0) ? '+' : '-',\n+\t\tabs($offhour),\n+\t\t$offmin,\n+\t);\n }\n \n my $have_email_valid = eval { require Email::Valid; 1 };\n@@ -194,30 +203,30 @@ my ($validate, $confirm);\n my (@suppress_cc);\n \n my %config_bool_settings = (\n-    \"thread\" => [\\$thread, 1],\n-    \"chainreplyto\" => [\\$chain_reply_to, 1],\n-    \"suppressfrom\" => [\\$suppress_from, undef],\n-    \"signedoffbycc\" => [\\$signed_off_by_cc, undef],\n-    \"signedoffcc\" => [\\$signed_off_by_cc, undef],      # Deprecated\n-    \"validate\" => [\\$validate, 1],\n+\t\"thread\" => [\\$thread, 1],\n+\t\"chainreplyto\" => [\\$chain_reply_to, 1],\n+\t\"suppressfrom\" => [\\$suppress_from, undef],\n+\t\"signedoffbycc\" => [\\$signed_off_by_cc, undef],\n+\t\"signedoffcc\" => [\\$signed_off_by_cc, undef],      # Deprecated\n+\t\"validate\" => [\\$validate, 1],\n );\n \n my %config_settings = (\n-    \"delay\" => \\$delay,\n-    \"smtpserver\" => \\$smtp_server,\n-    \"smtpserverport\" => \\$smtp_server_port,\n-    \"smtpuser\" => \\$smtp_authuser,\n-    \"smtppass\" => \\$smtp_authpass,\n-    \"to\" => \\@to,\n-    \"cc\" => \\@initial_cc,\n-    \"cccmd\" => \\$cc_cmd,\n-    \"aliasfiletype\" => \\$aliasfiletype,\n-    \"bcc\" => \\@bcclist,\n-    \"aliasesfile\" => \\@alias_files,\n-    \"suppresscc\" => \\@suppress_cc,\n-    \"envelopesender\" => \\$envelope_sender,\n-    \"multiedit\" => \\$multiedit,\n-    \"confirm\"   => \\$confirm,\n+\t\"delay\" => \\$delay,\n+\t\"smtpserver\" => \\$smtp_server,\n+\t\"smtpserverport\" => \\$smtp_server_port,\n+\t\"smtpuser\" => \\$smtp_authuser,\n+\t\"smtppass\" => \\$smtp_authpass,\n+\t\"to\" => \\@to,\n+\t\"cc\" => \\@initial_cc,\n+\t\"cccmd\" => \\$cc_cmd,\n+\t\"aliasfiletype\" => \\$aliasfiletype,\n+\t\"bcc\" => \\@bcclist,\n+\t\"aliasesfile\" => \\@alias_files,\n+\t\"suppresscc\" => \\@suppress_cc,\n+\t\"envelopesender\" => \\$envelope_sender,\n+\t\"multiedit\" => \\$multiedit,\n+\t\"confirm\"   => \\$confirm,\n );\n \n # Handle Uncouth Termination\n@@ -247,38 +256,39 @@ $SIG{INT}  = \\&signal_handler;\n # Begin by accumulating all the variables (defined above), that we will end up\n # needing, first, from the command line:\n \n-my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n-                    \"in-reply-to=s\" => \\$initial_reply_to,\n-\t\t    \"subject=s\" => \\$initial_subject,\n-\t\t    \"to=s\" => \\@to,\n-\t\t    \"cc=s\" => \\@initial_cc,\n-\t\t    \"bcc=s\" => \\@bcclist,\n-\t\t    \"chain-reply-to!\" => \\$chain_reply_to,\n-\t\t    \"delay=i\" => \\$delay,\n-\t\t    \"smtp-server=s\" => \\$smtp_server,\n-\t\t    \"smtp-server-port=i\" => \\$smtp_server_port,\n-\t\t    \"smtp-user=s\" => \\$smtp_authuser,\n-\t\t    \"smtp-pass:s\" => \\$smtp_authpass,\n-\t\t    \"smtp-ssl\" => sub { $smtp_encryption = 'ssl' },\n-\t\t    \"smtp-encryption=s\" => \\$smtp_encryption,\n-\t\t    \"identity=s\" => \\$identity,\n-\t\t    \"annotate\" => \\$annotate,\n-\t\t    \"compose:s\" => \\$compose,\n-\t\t    \"quiet\" => \\$quiet,\n-\t\t    \"cc-cmd=s\" => \\$cc_cmd,\n-\t\t    \"suppress-from!\" => \\$suppress_from,\n-\t\t    \"suppress-cc=s\" => \\@suppress_cc,\n-\t\t    \"signed-off-cc|signed-off-by-cc!\" => \\$signed_off_by_cc,\n-\t\t    \"confirm=s\" => \\$confirm,\n-\t\t    \"dry-run\" => \\$dry_run,\n-\t\t    \"envelope-sender=s\" => \\$envelope_sender,\n-\t\t    \"thread!\" => \\$thread,\n-\t\t    \"validate!\" => \\$validate,\n-\t\t    \"format-patch!\" => \\$format_patch,\n-\t );\n+my $rc = GetOptions(\n+\t\"sender|from=s\" => \\$sender,\n+\t\"in-reply-to=s\" => \\$initial_reply_to,\n+\t\"subject=s\" => \\$initial_subject,\n+\t\"to=s\" => \\@to,\n+\t\"cc=s\" => \\@initial_cc,\n+\t\"bcc=s\" => \\@bcclist,\n+\t\"chain-reply-to!\" => \\$chain_reply_to,\n+\t\"delay=i\" => \\$delay,\n+\t\"smtp-server=s\" => \\$smtp_server,\n+\t\"smtp-server-port=i\" => \\$smtp_server_port,\n+\t\"smtp-user=s\" => \\$smtp_authuser,\n+\t\"smtp-pass:s\" => \\$smtp_authpass,\n+\t\"smtp-ssl\" => sub { $smtp_encryption = 'ssl' },\n+\t\"smtp-encryption=s\" => \\$smtp_encryption,\n+\t\"identity=s\" => \\$identity,\n+\t\"annotate\" => \\$annotate,\n+\t\"compose:s\" => \\$compose,\n+\t\"quiet\" => \\$quiet,\n+\t\"cc-cmd=s\" => \\$cc_cmd,\n+\t\"suppress-from!\" => \\$suppress_from,\n+\t\"suppress-cc=s\" => \\@suppress_cc,\n+\t\"signed-off-cc|signed-off-by-cc!\" => \\$signed_off_by_cc,\n+\t\"confirm=s\" => \\$confirm,\n+\t\"dry-run\" => \\$dry_run,\n+\t\"envelope-sender=s\" => \\$envelope_sender,\n+\t\"thread!\" => \\$thread,\n+\t\"validate!\" => \\$validate,\n+\t\"format-patch!\" => \\$format_patch,\n+);\n \n unless ($rc) {\n-    usage();\n+\tusage();\n }\n \n die \"Cannot run git format-patch from outside a repository\\n\"\n@@ -407,29 +417,55 @@ sub split_addrs {\n my %aliases;\n my %parse_alias = (\n \t# multiline formats can be supported in the future\n-\tmutt => sub { my $fh = shift; while (<$fh>) {\n-\t\tif (/^\\s*alias\\s+(\\S+)\\s+(.*)$/) {\n-\t\t\tmy ($alias, $addr) = ($1, $2);\n-\t\t\t$addr =~ s/#.*$//; # mutt allows # comments\n-\t\t\t # commas delimit multiple addresses\n-\t\t\t$aliases{$alias} = [ split_addrs($addr) ];\n-\t\t}}},\n-\tmailrc => sub { my $fh = shift; while (<$fh>) {\n-\t\tif (/^alias\\s+(\\S+)\\s+(.*)$/) {\n-\t\t\t# spaces delimit multiple addresses\n-\t\t\t$aliases{$1} = [ split(/\\s+/, $2) ];\n-\t\t}}},\n-\tpine => sub { my $fh = shift; my $f='\\t[^\\t]*';\n-\t        for (my $x = ''; defined($x); $x = $_) {\n+\tmutt => sub {\n+\n+\t\tmy $fh = shift;\n+\n+\t\twhile (<$fh>) {\n+\t\t\tif (/^\\s*alias\\s+(\\S+)\\s+(.*)$/) {\n+\t\t\t\tmy ($alias, $addr) = ($1, $2);\n+\t\t\t\t$addr =~ s/#.*$//; # mutt allows # comments\n+\t\t\t\t# commas delimit multiple addresses\n+\t\t\t\t$aliases{$alias} = [ split_addrs($addr) ];\n+\t\t\t}\n+\t\t}\n+\t},\n+\n+\tmailrc => sub {\n+\n+\t\tmy $fh = shift;\n+\n+\t\twhile (<$fh>) {\n+\t\t\tif (/^alias\\s+(\\S+)\\s+(.*)$/) {\n+\t\t\t\t# spaces delimit multiple addresses\n+\t\t\t\t$aliases{$1} = [ split(/\\s+/, $2) ];\n+\t\t\t}\n+\t\t}\n+\t},\n+\n+\tpine => sub {\n+\n+\t\tmy $fh = shift;\n+\t\tmy $f='\\t[^\\t]*';\n+\n+\t\tfor (my $x = ''; defined($x); $x = $_) {\n \t\t\tchomp $x;\n-\t\t        $x .= $1 while(defined($_ = <$fh>) && /^ +(.*)$/);\n+\t\t\t$x .= $1 while(defined($_ = <$fh>) && /^ +(.*)$/);\n \t\t\t$x =~ /^(\\S+)$f\\t\\(?([^\\t]+?)\\)?(:?$f){0,2}$/ or next;\n \t\t\t$aliases{$1} = [ split_addrs($2) ];\n-\t\t}},\n-\tgnus => sub { my $fh = shift; while (<$fh>) {\n-\t\tif (/\\(define-mail-alias\\s+\"(\\S+?)\"\\s+\"(\\S+?)\"\\)/) {\n-\t\t\t$aliases{$1} = [ $2 ];\n-\t\t}}}\n+\t\t}\n+\t},\n+\n+\tgnus => sub {\n+\n+\t\tmy $fh = shift;\n+\n+\t\twhile (<$fh>) {\n+\t\t\tif (/\\(define-mail-alias\\s+\"(\\S+?)\"\\s+\"(\\S+?)\"\\)/) {\n+\t\t\t\t$aliases{$1} = [ $2 ];\n+\t\t\t}\n+\t\t}\n+\t}\n );\n \n if (@alias_files and $aliasfiletype and defined $parse_alias{$aliasfiletype}) {\n@@ -597,10 +633,11 @@ EOT\n \t\t} elsif (/^\\n$/) {\n \t\t\t$in_body = 1;\n \t\t\tif ($need_8bit_cte) {\n-\t\t\t\tprint $compose_final_file \"MIME-Version: 1.0\\n\",\n-\t\t\t\t\t \"Content-Type: text/plain; \",\n-\t\t\t\t\t   \"charset=utf-8\\n\",\n-\t\t\t\t\t \"Content-Transfer-Encoding: 8bit\\n\";\n+\t\t\t\tprint $compose_final_file\n+\t\t\t\t\t\"MIME-Version: 1.0\\n\",\n+\t\t\t\t\t\"Content-Type: text/plain; \",\n+\t\t\t\t\t\"charset=utf-8\\n\",\n+\t\t\t\t\t\"Content-Transfer-Encoding: 8bit\\n\";\n \t\t\t}\n \t\t} elsif (/^MIME-Version:/i) {\n \t\t\t$need_8bit_cte = 0;\n@@ -609,8 +646,8 @@ EOT\n \t\t\tmy $subject = $initial_subject;\n \t\t\t$_ = \"Subject: \" .\n \t\t\t\t($subject =~ /[^[:ascii:]]/ ?\n-\t\t\t\t quote_rfc2047($subject) :\n-\t\t\t\t $subject) .\n+\t\t\t\tquote_rfc2047($subject) :\n+\t\t\t\t$subject) .\n \t\t\t\t\"\\n\";\n \t\t} elsif (/^In-Reply-To:\\s*(.+)\\s*$/i) {\n \t\t\t$initial_reply_to = $1;\n@@ -639,8 +676,10 @@ sub ask {\n \tmy $resp;\n \tmy $i = 0;\n \treturn defined $default ? $default : undef\n-\t\tunless defined $term->IN and defined fileno($term->IN) and\n-\t\t       defined $term->OUT and defined fileno($term->OUT);\n+\t\tunless defined $term->IN\n+\t\t\tand defined fileno($term->IN)\n+\t\t\tand defined $term->OUT\n+\t\t\tand defined fileno($term->OUT);\n \twhile ($i++ < 10) {\n \t\t$resp = $term->readline($prompt);\n \t\tif (!defined $resp) { # EOF\n@@ -660,8 +699,12 @@ sub ask {\n my $prompting = 0;\n if (!defined $sender) {\n \t$sender = $repoauthor || $repocommitter || '';\n-\t$sender = ask(\"Who should the emails appear to be from? [$sender] \",\n-\t              default => $sender);\n+\n+\t$sender = ask(\n+\t\t\"Who should the emails appear to be from? [$sender] \",\n+\t\tdefault => $sender\n+\t);\n+\n \tprint \"Emails will be sent from: \", $sender, \"\\n\";\n \t$prompting++;\n }\n@@ -689,7 +732,8 @@ sub expand_aliases {\n \n if ($thread && !defined $initial_reply_to && $prompting) {\n \t$initial_reply_to = ask(\n-\t\t\"Message-ID to be used as In-Reply-To for the first email? \");\n+\t\t\"Message-ID to be used as In-Reply-To for the first email? \"\n+\t);\n }\n if (defined $initial_reply_to) {\n \t$initial_reply_to =~ s/^\\s*<?//;\n@@ -823,18 +867,22 @@ sub sanitize_address\n sub send_message\n {\n \tmy @recipients = unique_email_list(@to);\n-\t@cc = (grep { my $cc = extract_valid_address($_);\n-\t\t      not grep { $cc eq $_ } @recipients\n-\t\t    }\n-\t       map { sanitize_address($_) }\n-\t       @cc);\n+\n+\t@cc = (grep\n+\t\t{\n+\t\t\tmy $cc = extract_valid_address($_);\n+\t\t\tnot grep { $cc eq $_ } @recipients\n+\t\t}\n+\t\tmap { sanitize_address($_) } @cc\n+\t);\n+\n \tmy $to = join (\",\\n\\t\", @recipients);\n \t@recipients = unique_email_list(@recipients,@cc,@bcclist);\n \t@recipients = (map { extract_valid_address($_) } @recipients);\n \tmy $date = format_2822_time($time++);\n \tmy $gitversion = '@@GIT_VERSION@@';\n \tif ($gitversion =~ m/..GIT_VERSION../) {\n-\t    $gitversion = Git::version();\n+\t\t$gitversion = Git::version();\n \t}\n \n \tmy $cc = join(\", \", unique_email_list(@cc));\n@@ -883,9 +931,13 @@ X-Mailer: git-send-email $gitversion\n \t\t\tprint \"    To retain the current behavior, but squelch this message,\\n\";\n \t\t\tprint \"    run 'git config --global sendemail.confirm auto'.\\n\\n\";\n \t\t}\n-\t\t$_ = ask(\"Send this email? ([y]es|[n]o|[q]uit|[a]ll): \",\n-\t\t         valid_re => qr/^(?:yes|y|no|n|quit|q|all|a)/i,\n-\t\t         default => $ask_default);\n+\n+\t\t$_ = ask(\n+\t\t\t\"Send this email? ([y]es|[n]o|[q]uit|[a]ll): \",\n+\t\t\tvalid_re => qr/^(?:yes|y|no|n|quit|q|all|a)/i,\n+\t\t\tdefault => $ask_default\n+\t\t);\n+\n \t\tdie \"Send this email reply required\" unless defined $_;\n \t\tif (/^n/i) {\n \t\t\treturn;\n@@ -920,9 +972,13 @@ X-Mailer: git-send-email $gitversion\n \t\t}\n \t\telse {\n \t\t\trequire Net::SMTP;\n-\t\t\t$smtp ||= Net::SMTP->new((defined $smtp_server_port)\n-\t\t\t\t\t\t ? \"$smtp_server:$smtp_server_port\"\n-\t\t\t\t\t\t : $smtp_server);\n+\n+\t\t\t$smtp ||= Net::SMTP->new(\n+\t\t\t\t(defined $smtp_server_port)\n+\t\t\t\t\t? \"$smtp_server:$smtp_server_port\"\n+\t\t\t\t\t: $smtp_server\n+\t\t\t);\n+\n \t\t\tif ($smtp_encryption eq 'tls') {\n \t\t\t\trequire Net::SMTP::SSL;\n \t\t\t\t$smtp->command('STARTTLS');\n@@ -1018,7 +1074,7 @@ for (my $index = 0; $index < @files; $index++) {\n \t\t\tchomp($header[$#header]);\n \t\t\ts/^\\s+/ /;\n \t\t\t$header[$#header] .= $_;\n-\t    } else {\n+\t\t} else {\n \t\t\tpush(@header, $_);\n \t\t}\n \t}\n@@ -1136,9 +1192,9 @@ for (my $index = 0; $index < @files; $index++) {\n \t\t\t}\n \t\t\telse {\n \t\t\t\tpush @xh,\n-\t\t\t\t  'MIME-Version: 1.0',\n-\t\t\t\t  \"Content-Type: text/plain; charset=$author_encoding\",\n-\t\t\t\t  'Content-Transfer-Encoding: 8bit';\n+\t\t\t\t\t'MIME-Version: 1.0',\n+\t\t\t\t\t\"Content-Type: text/plain; charset=$author_encoding\",\n+\t\t\t\t\t'Content-Transfer-Encoding: 8bit';\n \t\t\t}\n \t\t}\n \t}\n@@ -1146,7 +1202,9 @@ for (my $index = 0; $index < @files; $index++) {\n \t$needs_confirm = (\n \t\t$confirm eq \"always\" or\n \t\t($confirm =~ /^(?:auto|cc)$/ && @cc) or\n-\t\t($confirm =~ /^(?:auto|compose)$/ && $compose && $message_num == 1));\n+\t\t($confirm =~ /^(?:auto|compose)$/ && $compose && $message_num == 1)\n+\t);\n+\n \t$needs_confirm = \"inform\" if ($needs_confirm && $confirm_unconfigured && @cc);\n \n \t@cc = (@initial_cc, @cc);\n-- \n1.6.2.2.448.g61445.dirty\n"},{"id":"110743","messageId":"9b18b3110904071435p320e5d1dh16061d04a3a8ab57@mail.gmail.com","threadId":"18770","inReplyTo":"1239139522-24118-6-git-send-email-mfwitten@gmail.com","subject":"Re: [PATCH RFC 6/6] send-email: Remove horrible mix of tabs and spaces","fromName":"demerphq","fromEmail":"demerphq@gmail.com","sentAt":"2009-04-07T21:35:07Z","receivedAt":"2009-04-07T21:35:07Z","isPatch":true,"sender":{"key":"demerphq@gmail.com","avatar":null},"body":"2009/4/7 Michael Witten <mfwitten@gmail.com>:\n> +## WARNING! ACHTUNG! ATTENTION! ADVERTENCIA!\n> +##   Currently, this file uses tabs (like the rest of git source) to\n> +##   delineate code structure. Do NOT under any circumstances mix tabs\n> +##   and spaces across lines that share a relationship in terms of layout.\n> +##   In fact, it would currently be best to use only tabs, so please set\n> +##   your editor(s) accordingly. This code is already trashy enough. Please\n> +##   don't make it worse.\n\nPerltidy the file?\n\nYves\n\n\n-- \nperl -Mre=debug -e \"/just|another|perl|hacker/\"\n"},{"id":"110745","messageId":"b4087cc50904071442ka298564x52112c1eac9ac284@mail.gmail.com","threadId":"18770","inReplyTo":"9b18b3110904071435p320e5d1dh16061d04a3a8ab57@mail.gmail.com","subject":"Re: [PATCH RFC 6/6] send-email: Remove horrible mix of tabs and spaces","fromName":"Michael Witten","fromEmail":"mfwitten@gmail.com","sentAt":"2009-04-07T21:42:36Z","receivedAt":"2009-04-07T21:42:36Z","isPatch":true,"sender":{"key":"mfwitten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/597101?v=4"},"body":"On Tue, Apr 7, 2009 at 16:35, demerphq <demerphq@gmail.com> wrote:\n> 2009/4/7 Michael Witten <mfwitten@gmail.com>:\n>> +## WARNING! ACHTUNG! ATTENTION! ADVERTENCIA!\n>> +##   Currently, this file uses tabs (like the rest of git source) to\n>> +##   delineate code structure. Do NOT under any circumstances mix tabs\n>> +##   and spaces across lines that share a relationship in terms of layout.\n>> +##   In fact, it would currently be best to use only tabs, so please set\n>> +##   your editor(s) accordingly. This code is already trashy enough. Please\n>> +##   don't make it worse.\n>\n> Perltidy the file?\n>\n> Yves\n\nOooh, that's sexy!\n\nI'll have to give that a try. However, I've been entertaining the idea\nof rewriting the whole thing anyway; it's in need of much more than\nreformatting.\n\nAs a side note, Yves, I sent the patches to perl5-porters again about\n1.6666666 hours ago, but nothing seems to have come through; I'll try\nagain later.\n\nMichael\n"},{"id":"110746","messageId":"9b18b3110904071444g2a8c4b66l9c22bd5ffabe3d6a@mail.gmail.com","threadId":"18770","inReplyTo":"b4087cc50904071442ka298564x52112c1eac9ac284@mail.gmail.com","subject":"Re: [PATCH RFC 6/6] send-email: Remove horrible mix of tabs and spaces","fromName":"demerphq","fromEmail":"demerphq@gmail.com","sentAt":"2009-04-07T21:44:31Z","receivedAt":"2009-04-07T21:44:31Z","isPatch":true,"sender":{"key":"demerphq@gmail.com","avatar":null},"body":"2009/4/7 Michael Witten <mfwitten@gmail.com>:\n> On Tue, Apr 7, 2009 at 16:35, demerphq <demerphq@gmail.com> wrote:\n>> 2009/4/7 Michael Witten <mfwitten@gmail.com>:\n>>> +## WARNING! ACHTUNG! ATTENTION! ADVERTENCIA!\n>>> +##   Currently, this file uses tabs (like the rest of git source) to\n>>> +##   delineate code structure. Do NOT under any circumstances mix tabs\n>>> +##   and spaces across lines that share a relationship in terms of layout.\n>>> +##   In fact, it would currently be best to use only tabs, so please set\n>>> +##   your editor(s) accordingly. This code is already trashy enough. Please\n>>> +##   don't make it worse.\n>>\n>> Perltidy the file?\n>>\n>> Yves\n>\n> Oooh, that's sexy!\n>\n> I'll have to give that a try. However, I've been entertaining the idea\n> of rewriting the whole thing anyway; it's in need of much more than\n> reformatting.\n\nYes. I notice evilness in there. Not necessarily dire burn your house\ndown evilness, but evilness none the less.\n\n> As a side note, Yves, I sent the patches to perl5-porters again about\n> 1.6666666 hours ago, but nothing seems to have come through; I'll try\n> again later.\n\nYou mean the 14 patches I just applied and pushed to blead?\n\n:-)\n\ncheers,\nYves\n\n\n\n-- \nperl -Mre=debug -e \"/just|another|perl|hacker/\"\n"},{"id":"110747","messageId":"20090407215143.GA18144@coredump.intra.peff.net","threadId":"18770","inReplyTo":"1239139522-24118-1-git-send-email-mfwitten@gmail.com","subject":"Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-07T21:51:43Z","receivedAt":"2009-04-07T21:51:43Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Apr 07, 2009 at 04:25:17PM -0500, Michael Witten wrote:\n\n> When sending a patch series, the emails often arrive at the final\n> destination out of order; though these emails should be chained\n> via the In-Reply-To headers, some mail-viewing systems display\n> by order of arrival instead.\n> \n> The --delay option provides a means for specifying that there\n> should be a certain number of seconds of delay between sending\n> emails, so that the arrival order can be controlled better.\n> \n> Signed-off-by: Michael Witten <mfwitten@gmail.com>\n\nI'm a little dubious how well this works in practice. Have you done any\nexperiments?\n\nThe reason I am dubious is that you are presumably delaying only a few\nseconds (since anything more would be quite annoying to the user). This\nmay deal with a short race condition in your local mail server. But what\nis the real cause of out-of-order delivery? Is it the local mail server\nseeing two messages essentially \"simultaneously\" and then reordering\nthem randomly? Or is it other random delays that happen _after_ that,\nlike network congestion, DNS lookups, down or congested servers, time it\ntakes to deliver the actual message body (e.g., if your mail server\nsends two simultaneously, but the first one is much larger and takes\nlonger to complete), etc.\n\nThose delays can be much larger than a few seconds, and this won't help\nat all there.\n\nI think it may still be reasonable to implement a solution that only\ncovers some of the cases, but I what I am asking is if we know what\npercentage of the cases that is. If we are preventing only 1% of\nout-of-order deliveries with this, I question whether it is worth the\nbother.\n\n-Peff\n"},{"id":"110749","messageId":"9b18b3110904071457gaad543bs2f621fa42fabb1b5@mail.gmail.com","threadId":"18770","inReplyTo":"9b18b3110904071444g2a8c4b66l9c22bd5ffabe3d6a@mail.gmail.com","subject":"Re: [PATCH RFC 6/6] send-email: Remove horrible mix of tabs and spaces","fromName":"demerphq","fromEmail":"demerphq@gmail.com","sentAt":"2009-04-07T21:57:22Z","receivedAt":"2009-04-07T21:57:22Z","isPatch":true,"sender":{"key":"demerphq@gmail.com","avatar":null},"body":"2009/4/7 demerphq <demerphq@gmail.com>:\n> 2009/4/7 Michael Witten <mfwitten@gmail.com>:\n>> On Tue, Apr 7, 2009 at 16:35, demerphq <demerphq@gmail.com> wrote:\n>>> 2009/4/7 Michael Witten <mfwitten@gmail.com>:\n>>>> +## WARNING! ACHTUNG! ATTENTION! ADVERTENCIA!\n>>>> +##   Currently, this file uses tabs (like the rest of git source) to\n>>>> +##   delineate code structure. Do NOT under any circumstances mix tabs\n>>>> +##   and spaces across lines that share a relationship in terms of layout.\n>>>> +##   In fact, it would currently be best to use only tabs, so please set\n>>>> +##   your editor(s) accordingly. This code is already trashy enough. Please\n>>>> +##   don't make it worse.\n>>>\n>>> Perltidy the file?\n>>>\n>>> Yves\n>>\n>> Oooh, that's sexy!\n>>\n>> I'll have to give that a try. However, I've been entertaining the idea\n>> of rewriting the whole thing anyway; it's in need of much more than\n>> reformatting.\n>\n> Yes. I notice evilness in there. Not necessarily dire burn your house\n> down evilness, but evilness none the less.\n\nBTW, I'd be glad to help out if you want, as I suspect would some of\nthe p5p folks.\n\nYves\n\n-- \nperl -Mre=debug -e \"/just|another|perl|hacker/\"\n"},{"id":"110750","messageId":"20090407220048.GB18144@coredump.intra.peff.net","threadId":"18770","inReplyTo":"b4087cc50904071442ka298564x52112c1eac9ac284@mail.gmail.com","subject":"Re: [PATCH RFC 6/6] send-email: Remove horrible mix of tabs and spaces","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-07T22:00:49Z","receivedAt":"2009-04-07T22:00:49Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Apr 07, 2009 at 04:42:36PM -0500, Michael Witten wrote:\n\n> I'll have to give that a try. However, I've been entertaining the idea\n> of rewriting the whole thing anyway; it's in need of much more than\n> reformatting.\n\nJust my two cents, but if you are considering re-writing send-email, I\nwould suggest two things:\n\n  1. Make much heavier use of existing CPAN libraries. A lot of the ugly\n     code is trying to handle corner cases in rfc2822 and mime parsing\n     and generation. And I would not be surprised if there were still\n     bugs in that ugly code.\n\n  2. Make a new command to compete with send-email instead of using the\n     same name. This means that people who are really put off by\n     CPAN dependencies from (1) above won't be negatively impacted. And\n     you can drop any historical interface warts if you want to.\n\n-Peff\n"},{"id":"110751","messageId":"20090407220854.GA12908@vidovic","threadId":"18770","inReplyTo":"20090407215143.GA18144@coredump.intra.peff.net","subject":"[PATCH RFC 1/6] Re: send-email: Add --delay for separating emails","fromName":"Nicolas Sebrecht","fromEmail":"nicolas.s-dev@laposte.net","sentAt":"2009-04-07T22:08:54Z","receivedAt":"2009-04-07T22:08:54Z","isPatch":true,"sender":{"key":"nicolas.s-dev@laposte.net","avatar":null},"body":"On Tue, Apr 07, 2009 at 05:51:43PM -0400, Jeff King wrote:\n\n> > When sending a patch series, the emails often arrive at the final\n> > destination out of order; though these emails should be chained\n> > via the In-Reply-To headers, some mail-viewing systems display\n> > by order of arrival instead.\n> > \n> > The --delay option provides a means for specifying that there\n> > should be a certain number of seconds of delay between sending\n> > emails, so that the arrival order can be controlled better.\n> > \n> > Signed-off-by: Michael Witten <mfwitten@gmail.com>\n\n> I think it may still be reasonable to implement a solution that only\n> covers some of the cases, but I what I am asking is if we know what\n> percentage of the cases that is. If we are preventing only 1% of\n> out-of-order deliveries with this, I question whether it is worth the\n> bother.\n\nIMHO, this improvement is broken by design. We try to fix a\nreceiver-only issue by a sender side fix.\n\nIf the receiver wants the patch series be in a good ordered _for sure_, he\nhas to switch to a client mail supporting the In-Reply-To chains.\n\n-- \nNicolas Sebrecht\n"},{"id":"110752","messageId":"49DBCF5D.6070404@op5.se","threadId":"18770","inReplyTo":"20090407220048.GB18144@coredump.intra.peff.net","subject":"Re: [PATCH RFC 6/6] send-email: Remove horrible mix of tabs and spaces","fromName":"Andreas Ericsson","fromEmail":"exon@op5.com","sentAt":"2009-04-07T22:10:37Z","receivedAt":"2009-04-07T22:10:37Z","isPatch":true,"sender":{"key":"exon@op5.com","avatar":null},"body":"Jeff King wrote:\n> On Tue, Apr 07, 2009 at 04:42:36PM -0500, Michael Witten wrote:\n> \n>> I'll have to give that a try. However, I've been entertaining the idea\n>> of rewriting the whole thing anyway; it's in need of much more than\n>> reformatting.\n> \n> Just my two cents, but if you are considering re-writing send-email, I\n> would suggest two things:\n> \n>   1. Make much heavier use of existing CPAN libraries. A lot of the ugly\n>      code is trying to handle corner cases in rfc2822 and mime parsing\n>      and generation. And I would not be surprised if there were still\n>      bugs in that ugly code.\n> \n>   2. Make a new command to compete with send-email instead of using the\n>      same name. This means that people who are really put off by\n>      CPAN dependencies from (1) above won't be negatively impacted. And\n>      you can drop any historical interface warts if you want to.\n> \n\n3. Make it capable of sending email directly from commits rather than\n   than having to generate them as files first. For bonus-points, use\n   git sequencer or some other \"git rebase -i\"-esque mangling thing\n   first, with capabilities of adding a cover-letter for patch-series.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"},{"id":"110753","messageId":"49DBD112.5000705@op5.se","threadId":"18770","inReplyTo":"20090407220854.GA12908@vidovic","subject":"Re: [PATCH RFC 1/6] Re: send-email: Add --delay for separating emails","fromName":"Andreas Ericsson","fromEmail":"exon@op5.com","sentAt":"2009-04-07T22:17:54Z","receivedAt":"2009-04-07T22:17:54Z","isPatch":true,"sender":{"key":"exon@op5.com","avatar":null},"body":"Nicolas Sebrecht wrote:\n> On Tue, Apr 07, 2009 at 05:51:43PM -0400, Jeff King wrote:\n> \n>>> When sending a patch series, the emails often arrive at the final\n>>> destination out of order; though these emails should be chained\n>>> via the In-Reply-To headers, some mail-viewing systems display\n>>> by order of arrival instead.\n>>>\n>>> The --delay option provides a means for specifying that there\n>>> should be a certain number of seconds of delay between sending\n>>> emails, so that the arrival order can be controlled better.\n>>>\n>>> Signed-off-by: Michael Witten <mfwitten@gmail.com>\n> \n>> I think it may still be reasonable to implement a solution that only\n>> covers some of the cases, but I what I am asking is if we know what\n>> percentage of the cases that is. If we are preventing only 1% of\n>> out-of-order deliveries with this, I question whether it is worth the\n>> bother.\n> \n> IMHO, this improvement is broken by design. We try to fix a\n> receiver-only issue by a sender side fix.\n> \n> If the receiver wants the patch series be in a good ordered _for sure_, he\n> has to switch to a client mail supporting the In-Reply-To chains.\n> \n\nThe biggest problem with in-reply-to chains is that they're absolutely\nhorrible for patch-series of more than five or so messages. The \"worst\"\none this week was a series of 14 patches, I believe. If any of the\ndeeper nested patches gets any sort of commentary, it usually eats so\nmuch horizontal screen estate that it becomes hopeless to actually\nfind anything.\n\nBesides that, most mua's I've worked with list emails in a thread\nlike this:\n\n First\n  +------ second\n  |         +------ third\n  |         |\n  |         +---- reply to second\n  |                 +\n  |                 |\n  |                 + reply to reply to second\n  |\n  +-- reply to first\n\netc. etc, but when asked for \"next unread message in thread\", they\njump to the *deepest* message in the thread first, so you end up\nreading the replies to the patches in the wrong order anyway.\n\nFor those two reasons, I absolutely loathe deeply nested\nin-reply-to chains.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n\nConsidering the successes of the wars on alcohol, poverty, drugs and\nterror, I think we should give some serious thought to declaring war\non peace.\n"},{"id":"110756","messageId":"7vd4boxdd9.fsf@gitster.siamese.dyndns.org","threadId":"18770","inReplyTo":"1239139522-24118-1-git-send-email-mfwitten@gmail.com","subject":"Re: [PATCH RFC 1/6] send-email: Add --delay for separating emails","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-07T23:17:38Z","receivedAt":"2009-04-07T23:17:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Witten <mfwitten@gmail.com> writes:\n\n> When sending a patch series, the emails often arrive at the final\n> destination out of order; though these emails should be chained\n> via the In-Reply-To headers, some mail-viewing systems display\n> by order of arrival instead.\n>\n> The --delay option provides a means for specifying that there\n> should be a certain number of seconds of delay between sending\n> emails, so that the arrival order can be controlled better.\n\nIf you are trying to force the order of messages that the client MUA\nphysically receives the messages, I do not think giving N second\ninterval at the sending end would help much in the real world.  Between\nyour submitting MUA (that's \"git-send-email\") and the client MUA, there\nare many hops involved:\n\n * Your outgoing MSA (typically your ISP's sendmail) your MUA hands\n   messages to;\n\n * Your ISP's internal mail routing chain of MTAs that forward the\n   messages around;\n\n * The recipient's ISP's incoming MTA that receives the messages from\n   your ISP's outgoing MTA;\n\n * The recipient's ISP's internal mail routing chain of MTAs that\n   forward the messages around, until they reach...\n\n * ... the mailbox at recipient's ISP that stores the messages until the\n   recipient picks them up;\n\n * And finally the recipient's MUA that reads from the mailbox.\n\nMessages your MUA sends out can take different paths in the above chain\neven though the final destination (mailbox at the recipient's ISP) may\nbe the same, and different mailpaths can and do have different\nlatencies.  Even if all the messages sent out by a single invocation of\nyour submitting MUA happened to take the same mailpath, any single hop\ncan batch the messages that arrive within a small time window before\npassing them to the next hop, and it can reorder the messages when it\ndoes so.\n\nIn short, the only thing your --delay can control is the arrival\ninterval at your outgoing MSA.  The arrival interval and order of\nmessages are outside your control for later hops.\n\nOn the other hand, I think send-email already has hacks to timestamp the\nmessages at least one-second apart by shifting the Date: field, so that\nthe recipient MUA can sort by the departure timestamp if it wants to (and\nif it can), instead of the arrival timestamp.  Is it not working well for\nyou?\n"},{"id":"110757","messageId":"7v8wmcxd8y.fsf@gitster.siamese.dyndns.org","threadId":"18770","inReplyTo":"1239139522-24118-2-git-send-email-mfwitten@gmail.com","subject":"Re: [PATCH RFC 2/6] send-email: --smtp-server-port should take an integer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-07T23:20:13Z","receivedAt":"2009-04-07T23:20:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I think this makes sense but you made it depend on your --delay patch, so\nit won't apply without wiggling the patch by hand.\n\nI can do that, but a good rule of thumb when preparing a series is to have\nthis kind of obvious clean-up first, leaving enhancement patches later in\nthe series.\n"},{"id":"110760","messageId":"BEB50B8F-2E86-428E-9E9B-C48FC24A2BA5@dbservice.com","threadId":"18770","inReplyTo":"49DBCF5D.6070404@op5.se","subject":"Re: [PATCH RFC 6/6] send-email: Remove horrible mix of tabs and spaces","fromName":"Tomas Carnecky","fromEmail":"tom@dbservice.com","sentAt":"2009-04-07T23:33:01Z","receivedAt":"2009-04-07T23:33:01Z","isPatch":true,"sender":{"key":"tom@dbservice.com","avatar":"https://gravatar.com/avatar/900a300bdd1a8bbe086008ad78210bbee2ad2803b7d50a5cba04c1e9404bd6d2?d=mp&s=160"},"body":"\nOn Apr 8, 2009, at 12:10 AM, Andreas Ericsson wrote:\n> 3. Make it capable of sending email directly from commits rather than\n>  than having to generate them as files first. For bonus-points, use\n\nThis is already possible:\n   git send-email [options] <file|directory|rev-list options>\nYou can pass it a rev-list and it will generate the patches on its own.\n\n>  git sequencer or some other \"git rebase -i\"-esque mangling thing\n>  first, with capabilities of adding a cover-letter for patch-series.\n\n\ntom\n"},{"id":"110765","messageId":"20090408020252.GA18244@coredump.intra.peff.net","threadId":"18770","inReplyTo":"49DBCF5D.6070404@op5.se","subject":"Re: [PATCH RFC 6/6] send-email: Remove horrible mix of tabs and spaces","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-08T02:02:52Z","receivedAt":"2009-04-08T02:02:52Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Apr 08, 2009 at 12:10:37AM +0200, Andreas Ericsson wrote:\n\n>>   2. Make a new command to compete with send-email instead of using the\n>>      same name. This means that people who are really put off by\n>>      CPAN dependencies from (1) above won't be negatively impacted. And\n>>      you can drop any historical interface warts if you want to.\n>>\n>\n> 3. Make it capable of sending email directly from commits rather than\n>   than having to generate them as files first. For bonus-points, use\n>   git sequencer or some other \"git rebase -i\"-esque mangling thing\n>   first, with capabilities of adding a cover-letter for patch-series.\n\nAs Tomas noted, this is already possible (this was due to some patches\nfrom Pierre a few months ago, I think). But IIRC, there are some corner\ncases where send-email has to guess whether you mean rev-list options or\na file (or maybe there is some way to signal, I don't remember). And\nthat is exactly the sort of thing that you could clean up via (2) above.\n\n-Peff\n"},{"id":"110788","messageId":"20090408060350.GA26079@coredump.intra.peff.net","threadId":"18770","inReplyTo":"20090407220854.GA12908@vidovic","subject":"Re: [PATCH RFC 1/6] Re: send-email: Add --delay for separating emails","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-08T06:03:50Z","receivedAt":"2009-04-08T06:03:50Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Apr 08, 2009 at 12:08:54AM +0200, Nicolas Sebrecht wrote:\n\n> > I think it may still be reasonable to implement a solution that only\n> > covers some of the cases, but I what I am asking is if we know what\n> > percentage of the cases that is. If we are preventing only 1% of\n> > out-of-order deliveries with this, I question whether it is worth the\n> > bother.\n> \n> IMHO, this improvement is broken by design. We try to fix a\n> receiver-only issue by a sender side fix.\n\nI almost said the same thing: it is really the receiver's problem.\nHowever, that doesn't mean the sender can't do simple things to help\nhint the right thing to the receiver. For example, we already munge the\ndate fields to make sure the timestamp in each patch is increasing.\n\nSo there is precedent for giving hints to help the receiver sort the\npatches. But munging the date fields is relatively transparent to the\nsener. A multi-second delay is downright annoying. As a sender, I don't\nthink I would enable this option.\n\n> If the receiver wants the patch series be in a good ordered _for sure_, he\n> has to switch to a client mail supporting the In-Reply-To chains.\n\nThat's not enough for shallow-style patch series, like:\n\n  PATCH 0/3\n    \\->PATCH 1/3\n    \\->PATCH 2/3\n    \\->PATCH 3/3\n\nwhich is the proposed default for v1.6.3.\n\nMany readers will sort by rfc822 date within a single thread level,\nwhich is sufficient with what send-email currently generates. Sorting by\nsubject should also work fine.\n\nBut apparently many readers sort by date received. See this subthread:\n\n  http://article.gmane.org/gmane.comp.version-control.git/110097\n\nI am generally of the opinion that if it is a big problem for people,\nthey should get a better mail client. But I am also open to suggestions\nfor helping receivers on crappy mail clients as long as those\nsuggestions do not put a burden on the sender.\n\n-Peff\n"},{"id":"110789","messageId":"20090408060552.GB26079@coredump.intra.peff.net","threadId":"18770","inReplyTo":"49DBD112.5000705@op5.se","subject":"Re: [PATCH RFC 1/6] Re: send-email: Add --delay for separating emails","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-04-08T06:05:52Z","receivedAt":"2009-04-08T06:05:52Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Apr 08, 2009 at 12:17:54AM +0200, Andreas Ericsson wrote:\n\n> For those two reasons, I absolutely loathe deeply nested\n> in-reply-to chains.\n\nAgreed.  I don't know if you saw:\n\n  http://article.gmane.org/gmane.comp.version-control.git/109790\n\na while back.\n\n-Peff\n"},{"id":"111072","messageId":"7vvdpbf11m.fsf@gitster.siamese.dyndns.org","threadId":"18770","inReplyTo":"1239139522-24118-2-git-send-email-mfwitten@gmail.com","subject":"Re: [PATCH RFC 2/6] send-email: --smtp-server-port should take an integer","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-11T19:22:29Z","receivedAt":"2009-04-11T19:22:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Witten <mfwitten@gmail.com> writes:\n\n> Signed-off-by: Michael Witten <mfwitten@gmail.com>\n> ---\n>  git-send-email.perl |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 273c8c7..63d6063 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -251,7 +251,7 @@ my $rc = GetOptions(\"sender|from=s\" => \\$sender,\n>  \t\t    \"chain-reply-to!\" => \\$chain_reply_to,\n>  \t\t    \"delay=i\" => \\$delay,\n>  \t\t    \"smtp-server=s\" => \\$smtp_server,\n> -\t\t    \"smtp-server-port=s\" => \\$smtp_server_port,\n> +\t\t    \"smtp-server-port=i\" => \\$smtp_server_port,\n>  \t\t    \"smtp-user=s\" => \\$smtp_authuser,\n>  \t\t    \"smtp-pass:s\" => \\$smtp_authpass,\n>  \t\t    \"smtp-ssl\" => sub { $smtp_encryption = 'ssl' },\n\nHmm, I have to wonder if there somebody who is using symbolic names for\nports, e.g. --smtp-server-port=ssmtp which this patch may start\nrejecting.\n"},{"id":"111071","messageId":"7vprfjf11h.fsf@gitster.siamese.dyndns.org","threadId":"18770","inReplyTo":"1239139522-24118-3-git-send-email-mfwitten@gmail.com","subject":"Re: [PATCH RFC 3/6] send-email: Handle \"GIT:\" rather than \"GIT: \" during --compose","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-11T19:22:34Z","receivedAt":"2009-04-11T19:22:34Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Witten <mfwitten@gmail.com> writes:\n\n> This should make things a little more robust in terms of user input;\n> before, even the program got it wrong by outputting a line with only\n> \"GIT:\", which was left in place as a header, because there would be\n> no following space character.\n\nAn alternative could be to add an extra space after the \"GIT:\" on the\nlines the compose template generated by this program, but people can set\ntheir editors to strip trailing whitespaces, so I think yours is a better\napproach.  I suspect this patch comes from your own experience of getting\nbitten by this once, perhaps?\n\n> Also, I cleaned up get_patch_subject().\n\nWhich is a bit iffy.  It does not belong to the primary topic of the patch\nto begin with, so it shouldn't be in here even if it weren't iffy.\n\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 63d6063..098c620 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -505,15 +505,16 @@ if (@files) {\n>  }\n>  \n>  sub get_patch_subject($) {\n> -\tmy $fn = shift;\n> -\topen (my $fh, '<', $fn);\n> -\twhile (my $line = <$fh>) {\n> -\t\tnext unless ($line =~ /^Subject: (.*)$/);\n> -\t\tclose $fh;\n> -\t\treturn \"GIT: $1\\n\";\n> +\n> +\tmy $patch = shift;\n> +\topen (my $fh, '<', $patch);\n> +\n> +\twhile (<$fh>) {\n> +\t\tnext unless (/^Subject: (.*)$/);\n> +\t\treturn $1;\n>  \t}\n> -\tclose $fh;\n> -\tdie \"No subject line in $fn ?\";\n> +\n> +\tdie \"'Subject:' line expected in '$patch'\";\n>  }\n\nBecause \"while (<>)\" does not localize $_, you are clobbering it in the\ncaller's context.  I do not know if any of the the existing callers cares,\nbut it is a change in behaviour.\n\n$ cat >/var/tmp/j.perl <<\\EOF\n#!/usr/bin/perl -w\nuse strict;\nsub foo($) {\n\tmy $name = shift;\n\topen my $fh, \"<$name\";\n\twhile (my $line = <$fh>) {\n\t\tchomp $line;\n\t\tclose $fh;\n\t\treturn $line;\n\t}\n\tclose $fh;\n\treturn undef;\n}\nsub bar($) {\n\tmy $name = shift;\n\topen my $fh, \"<$name\";\n\twhile (<$fh>) {\n\t\tchomp;\n\t\tclose $fh;\n\t\treturn $_;\n\t}\n\tclose $fh;\n\treturn undef;\n}\n$_ = 'original';\nfoo($0);\nprint \"after running foo: $_\\n\";\n\n$_ = 'original';\nbar($0);\nprint \"after running bar: $_\\n\";\nEOF\n$ perl /var/tmp/j.perl\nafter running foo: original\nafter running bar: #!/usr/bin/perl -w\n$ exit\n"},{"id":"111076","messageId":"7vk55rf11c.fsf@gitster.siamese.dyndns.org","threadId":"18770","inReplyTo":"1239139522-24118-4-git-send-email-mfwitten@gmail.com","subject":"Re: [PATCH RFC 4/6] send-email: --compose takes optional argument to existing file","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-11T19:22:39Z","receivedAt":"2009-04-11T19:22:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Witten <mfwitten@gmail.com> writes:\n\n> Now, a user may specify an existing (in-progress) file to use as\n> the introductory/summary email.\n>\n> The file is opened for any additional editing as usual.\n>\n> Signed-off-by: Michael Witten <mfwitten@gmail.com>\n> ---\n>  Documentation/git-send-email.txt |    7 ++-\n>  git-send-email.perl              |  112 ++++++++++++++++++++++----------------\n>  2 files changed, 71 insertions(+), 48 deletions(-)\n>\n> diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt\n> index 4b656ca..bc9ff13 100644\n> --- a/Documentation/git-send-email.txt\n> +++ b/Documentation/git-send-email.txt\n> @@ -57,8 +57,11 @@ The --cc option must be repeated for each user you want on the cc list.\n>  \tor one for all of them at once.\n>  \n>  --compose::\n> -\tUse $GIT_EDITOR, core.editor, $VISUAL, or $EDITOR to edit an\n> -\tintroductory message for the patch series.\n> +\tUse $GIT_EDITOR, core.editor, $VISUAL, or $EDITOR, or vi to edit an\n\nI think addition of \", or vi\" makes sense but the \", or $EDITOR\" needs to\nchange, and also the language needs to be clarified to say the first one\nof these is used.\n\nThe name of the new variable $compose_file that is used as a filehandle\nwas confusing to read (almost everybody else in the program uses $fh, and\nit looked as if $compose_file is talking about the name of the file or\nindirectly pointing at an existing filehandle, but it was not).\n"},{"id":"111073","messageId":"7veivzf117.fsf@gitster.siamese.dyndns.org","threadId":"18770","inReplyTo":"1239139522-24118-5-git-send-email-mfwitten@gmail.com","subject":"Re: [PATCH RFC 5/6] send-email: Cleanup the usage text a bit","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-11T19:22:44Z","receivedAt":"2009-04-11T19:22:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Witten <mfwitten@gmail.com> writes:\n\n> All lines should be < 80 characters.\n>\n> Signed-off-by: Michael Witten <mfwitten@gmail.com>\n> ---\n>  git-send-email.perl |   16 +++++++++++-----\n>  1 files changed, 11 insertions(+), 5 deletions(-)\n>\n> diff --git a/git-send-email.perl b/git-send-email.perl\n> index 481bf36..c3e3598 100755\n> --- a/git-send-email.perl\n> +++ b/git-send-email.perl\n> @@ -42,6 +42,9 @@ package main;\n>  \n>  \n>  sub usage {\n> +\n> +\t# All printed lines should be less than 80 characters.\n> +\n\nPerhaps a good idea.  It would have been nicer if this were early in the\nseries.\n"},{"id":"111095","messageId":"b4087cc50904111345v4787f38al9d7d234de8a6d24e@mail.gmail.com","threadId":"18770","inReplyTo":"7vprfjf11h.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH RFC 3/6] send-email: Handle \"GIT:\" rather than \"GIT: \" during --compose","fromName":"Michael Witten","fromEmail":"mfwitten@gmail.com","sentAt":"2009-04-11T20:45:53Z","receivedAt":"2009-04-11T20:45:53Z","isPatch":true,"sender":{"key":"mfwitten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/597101?v=4"},"body":"On Sat, Apr 11, 2009 at 14:22, Junio C Hamano <gitster@pobox.com> wrote:\n> Michael Witten <mfwitten@gmail.com> writes:\n>\n>> This should make things a little more robust in terms of user input;\n>> before, even the program got it wrong by outputting a line with only\n>> \"GIT:\", which was left in place as a header, because there would be\n>> no following space character.\n>\n> An alternative could be to add an extra space after the \"GIT:\" on the\n> lines the compose template generated by this program, but people can set\n> their editors to strip trailing whitespaces, so I think yours is a better\n> approach.  I suspect this patch comes from your own experience of getting\n> bitten by this once, perhaps?\n\nMy first thought was indeed just to add an extra space, but it occurred to me\nthat it's not easily remembered. Consider the original documentation:\n\n> If the body of the message (what you type after the headers and a blank line) only contains blank (or GIT: prefixed) lines the summary won't be sent\n\n>> Also, I cleaned up get_patch_subject().\n>\n> Which is a bit iffy.  It does not belong to the primary topic of the patch\n> to begin with, so it shouldn't be in here even if it weren't iffy.\n\nI can split it into another patch.\n\n> Because \"while (<>)\" does not localize $_, you are clobbering it in the\n> caller's context.  I do not know if any of the the existing callers cares,\n> but it is a change in behaviour.\n\nHow about:\n\n    while (local $_ = <$fh>)\n\nOr, in our case, this:\n\n    while (my $_ = <$fh>)\n\nIn testing these, I came across behavior that I think is incorrect, and I\nhave a mind to complain about it to the perl guys:\n\n# Well! the print `function' doesn't seem to play by the rules.\n\n# Example 0\n# I expect the output to be:\n# 1\n# 1\n# 3\n# and I am right!\n\n$_ = 3;\n\n{\n  local $_ = 1;\n  print; print \"\\n\";\n  print $_; print \"\\n\";\n}\n\nprint; print \"\\n\";\n\n##############################################\n\n# Example 1\n# I expect the output to be:\n# 3\n# 1\n# 3\n# But it is:\n# 1\n# 1\n# 3\n\n$_ = 3;\n\n{\n  my $_ = 1;\n  print; print \"\\n\";\n  print $_; print \"\\n\";\n}\n\nprint; print \"\\n\";\n\n###############################################\n\n# Example 2\n# I expect the output to be:\n# 1\n# 1\n# 3\n# and I am right!\n\nsub my_print {\n  print(shift or $_);\n}\n\n$_ = 3;\n\n{\n  local $_ = 1;\n  my_print; print \"\\n\";\n  my_print $_; print \"\\n\";\n}\n\nmy_print; print \"\\n\";\n\n###############################################\n\n# Example 3\n# I expect the output to be:\n# 3\n# 1\n# 3\n# and I am right this time!\n\nsub my_print {\n  print(shift or $_);\n}\n\n$_ = 3;\n\n{\n  my $_ = 1;\n  my_print; print \"\\n\";\n  my_print $_; print \"\\n\";\n}\n\nmy_print; print \"\\n\";\n"},{"id":"111098","messageId":"200904111501.05734.wjl@icecavern.net","threadId":"18770","inReplyTo":"7vvdpbf11m.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH RFC 2/6] send-email: --smtp-server-port should take an integer","fromName":"Wesley J. Landaker","fromEmail":"wjl@icecavern.net","sentAt":"2009-04-11T21:01:05Z","receivedAt":"2009-04-11T21:01:05Z","isPatch":true,"sender":{"key":"wjl@icecavern.net","avatar":"https://avatars.githubusercontent.com/u/67229?v=4"},"body":"On Saturday 11 April 2009 13:22:29 Junio C Hamano wrote:\n> Hmm, I have to wonder if there somebody who is using symbolic names for\n> ports, e.g. --smtp-server-port=ssmtp which this patch may start\n> rejecting.\n\nAn common example is --smtp-server-port=submission (for 587).\n"},{"id":"111099","messageId":"b4087cc50904111407n27aea57n22772c09557f177@mail.gmail.com","threadId":"18770","inReplyTo":"200904111501.05734.wjl@icecavern.net","subject":"Re: [PATCH RFC 2/6] send-email: --smtp-server-port should take an integer","fromName":"Michael Witten","fromEmail":"mfwitten@gmail.com","sentAt":"2009-04-11T21:07:08Z","receivedAt":"2009-04-11T21:07:08Z","isPatch":true,"sender":{"key":"mfwitten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/597101?v=4"},"body":"On Sat, Apr 11, 2009 at 16:01, Wesley J. Landaker <wjl@icecavern.net> wrote:\n> On Saturday 11 April 2009 13:22:29 Junio C Hamano wrote:\n>> Hmm, I have to wonder if there somebody who is using symbolic names for\n>> ports, e.g. --smtp-server-port=ssmtp which this patch may start\n>> rejecting.\n>\n> An common example is --smtp-server-port=submission (for 587).\n\nClearly, then, this patch is no good. Consider it thrown out.\n"},{"id":"111110","messageId":"7v3aced6vr.fsf@gitster.siamese.dyndns.org","threadId":"18770","inReplyTo":"b4087cc50904111345v4787f38al9d7d234de8a6d24e@mail.gmail.com","subject":"Re: [PATCH RFC 3/6] send-email: Handle \"GIT:\" rather than \"GIT: \" during --compose","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-04-12T00:59:20Z","receivedAt":"2009-04-12T00:59:20Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Witten <mfwitten@gmail.com> writes:\n\n>> Because \"while (<>)\" does not localize $_, you are clobbering it in the\n>> caller's context.  I do not know if any of the the existing callers cares,\n>> but it is a change in behaviour.\n>\n> How about:\n>\n>     while (local $_ = <$fh>)\n>\n> Or, in our case, this:\n>\n>     while (my $_ = <$fh>)\n\nSpecial variables like $_ cannot be made into lexicals, unless you know\nyou will only run with a very recent version of Perl (5.9.1, I think).\n\nIf you do not want to worry about portability, typically it is easiest to\nsay \"local ($_)\" upfront in the beginning of a sub.\n\nI do not understand why you want to change the original\n\n\twhile (my $line = <$fh>) {\n        \t...\n\t}\n\nthough.\n"},{"id":"111113","messageId":"b4087cc50904111936r6cbde773scbe5e7243442dc79@mail.gmail.com","threadId":"18770","inReplyTo":"7v3aced6vr.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH RFC 3/6] send-email: Handle \"GIT:\" rather than \"GIT: \" during --compose","fromName":"Michael Witten","fromEmail":"mfwitten@gmail.com","sentAt":"2009-04-12T02:36:48Z","receivedAt":"2009-04-12T02:36:48Z","isPatch":true,"sender":{"key":"mfwitten@gmail.com","avatar":"https://avatars.githubusercontent.com/u/597101?v=4"},"body":"On Sat, Apr 11, 2009 at 19:59, Junio C Hamano <gitster@pobox.com> wrote:\n> Special variables like $_ cannot be made into lexicals, unless you know\n> you will only run with a very recent version of Perl (5.9.1, I think).\n\nAh. I wish Perl's docs were a little more forthcoming about such\nthings. I ended up just trying it out, and indeed I am running 5.10.0.\n\n> If you do not want to worry about portability, typically it is easiest to\n> say \"local ($_)\" upfront in the beginning of a sub.\n>\n> I do not understand why you want to change the original\n>\n>        while (my $line = <$fh>) {\n>                ...\n>        }\n>\n> though.\n\nI'm not terribly bent on it; I had already reshaped that function and\nI was curious about making what I had done work out of intellectual\ncuriosity. In fact, my commits no longer have the refactored version.\n"}]}