From 432b128220e8665d361345117201b34fe2fccba8 Mon Sep 17 00:00:00 2001 From: Michael Witten Date: Mon, 13 Apr 2009 13:23:45 -0500 Subject: [PATCH 1/6] Docs: send-email: Put options back into alphabetical order Signed-off-by: Michael Witten Signed-off-by: Junio C Hamano --- Documentation/git-send-email.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt index 0b1f183ce8..4db5a09604 100644 --- a/Documentation/git-send-email.txt +++ b/Documentation/git-send-email.txt @@ -39,6 +39,11 @@ OPTIONS Composing ~~~~~~~~~ +--annotate:: + Review each patch you're about to send in an editor. The setting + 'sendemail.multiedit' defines if this will spawn one editor per patch + or one for all of them at once. + --bcc=
:: Specify a "Bcc:" value for each email. Default is the value of 'sendemail.bcc'. @@ -51,11 +56,6 @@ The --bcc option must be repeated for each user you want on the bcc list. + The --cc option must be repeated for each user you want on the cc list. ---annotate:: - Review each patch you're about to send in an editor. The setting - 'sendemail.multiedit' defines if this will spawn one editor per patch - or one for all of them at once. - --compose:: Use $GIT_EDITOR, core.editor, $VISUAL, or $EDITOR to edit an introductory message for the patch series. @@ -230,6 +230,12 @@ have been specified, in which case default to 'compose'. --dry-run:: Do everything except actually send the emails. +--[no-]format-patch:: + When an argument may be understood either as a reference or as a file name, + choose to understand it as a format-patch argument ('--format-patch') + or as a file name ('--no-format-patch'). By default, when such a conflict + occurs, git send-email will fail. + --quiet:: Make git-send-email less verbose. One line per email should be all that is output. @@ -246,12 +252,6 @@ have been specified, in which case default to 'compose'. Default is the value of 'sendemail.validate'; if this is not set, default to '--validate'. ---[no-]format-patch:: - When an argument may be understood either as a reference or as a file name, - choose to understand it as a format-patch argument ('--format-patch') - or as a file name ('--no-format-patch'). By default, when such a conflict - occurs, git send-email will fail. - CONFIGURATION ------------- From 3a78d078273f9eeb1f3eea06296b9901d7858d96 Mon Sep 17 00:00:00 2001 From: Michael Witten Date: Mon, 13 Apr 2009 13:23:46 -0500 Subject: [PATCH 2/6] Docs: send-email: Refer to CONFIGURATION section for sendemail.multiedit Replace description of sendemail.multiedit in --annotate docs with a reference to the CONFIGURATION section. Add such a reference to the --compose documentation. Signed-off-by: Michael Witten Signed-off-by: Junio C Hamano --- Documentation/git-send-email.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt index 4db5a09604..7b87d6e1da 100644 --- a/Documentation/git-send-email.txt +++ b/Documentation/git-send-email.txt @@ -40,9 +40,8 @@ Composing ~~~~~~~~~ --annotate:: - Review each patch you're about to send in an editor. The setting - 'sendemail.multiedit' defines if this will spawn one editor per patch - or one for all of them at once. + Review and edit each patch you're about to send. See the + CONFIGURATION section for 'sendemail.multiedit'. --bcc=
:: Specify a "Bcc:" value for each email. Default is the value of @@ -67,6 +66,8 @@ In-Reply-To headers specified in the message. If the body of the message and In-Reply-To headers will be used unless they are removed. + Missing From or In-Reply-To headers will be prompted for. ++ +See the CONFIGURATION section for 'sendemail.multiedit'. --from=
:: Specify the sender of the emails. This will default to From dd602bf8ec9b6ef422e5cf8a490c381c0bb037ed Mon Sep 17 00:00:00 2001 From: Michael Witten Date: Mon, 13 Apr 2009 13:23:48 -0500 Subject: [PATCH 3/6] Docs: send-email: --smtp-server-port can take symbolic ports Signed-off-by: Michael Witten Signed-off-by: Junio C Hamano --- Documentation/git-send-email.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt index 7b87d6e1da..f7e428eb50 100644 --- a/Documentation/git-send-email.txt +++ b/Documentation/git-send-email.txt @@ -136,7 +136,9 @@ user is prompted for a password while the input is masked for privacy. --smtp-server-port=:: Specifies a port different from the default port (SMTP servers typically listen to smtp port 25 and ssmtp port - 465). This can be set with 'sendemail.smtpserverport'. + 465); symbolic port names (e.g. "submission" instead of 465) + are also accepted. The port can also be set with the + 'sendemail.smtpserverport' configuration variable. --smtp-ssl:: Legacy alias for '--smtp-encryption ssl'. From 40e6e8a0c485e618be366f13247fd745ac00b911 Mon Sep 17 00:00:00 2001 From: Michael Witten Date: Mon, 13 Apr 2009 13:23:50 -0500 Subject: [PATCH 4/6] send-email: Handle "GIT:" rather than "GIT: " during --compose This should make things a little more robust in terms of user input; before, even the program got it wrong by outputting a line with only "GIT:", which was left in place as a header, because there would be no following space character. Signed-off-by: Michael Witten Signed-off-by: Junio C Hamano --- git-send-email.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-send-email.perl b/git-send-email.perl index 172b53c2d5..7526ade761 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -529,7 +529,7 @@ if ($compose) { print C <) { - next if m/^GIT: /; + next if m/^GIT:/; if ($in_body) { $summary_empty = 0 unless (/^\n$/); } elsif (/^\n$/) { From 15da10843135490e12efca7f8bc806ae0bcf5c53 Mon Sep 17 00:00:00 2001 From: Michael Witten Date: Mon, 13 Apr 2009 13:23:51 -0500 Subject: [PATCH 5/6] send-email: 'References:' should only reference what is sent If someone responded with a negative (n|no) to the confirmation, then the Message-ID of the discarded email is no longer used in the References: header of subsequent emails. Consequently, send_message() now returns 1 if the message was sent and 0 otherwise. Signed-off-by: Michael Witten Signed-off-by: Junio C Hamano --- git-send-email.perl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/git-send-email.perl b/git-send-email.perl index 7526ade761..43f956b780 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -796,6 +796,10 @@ sub sanitize_address } +# Returns 1 if the message was sent, and 0 otherwise. +# In actuality, the whole program dies when a there +# is an error sending a message. + sub send_message { my @recipients = unique_email_list(@to); @@ -864,7 +868,7 @@ X-Mailer: git-send-email $gitversion default => $ask_default); die "Send this email reply required" unless defined $_; if (/^n/i) { - return; + return 0; } elsif (/^q/i) { cleanup_compose_files(); exit(0); @@ -945,7 +949,7 @@ X-Mailer: git-send-email $gitversion $smtp->data or die $smtp->message; $smtp->datasend("$header\n$message") or die $smtp->message; $smtp->dataend() or die $smtp->message; - $smtp->ok or die "Failed to send $subject\n".$smtp->message; + $smtp->code =~ /250|200/ or die "Failed to send $subject\n".$smtp->message; } if ($quiet) { printf (($dry_run ? "Dry-" : "")."Sent %s\n", $subject); @@ -966,6 +970,8 @@ X-Mailer: git-send-email $gitversion print "Result: OK\n"; } } + + return 1; } $reply_to = $initial_reply_to; @@ -1126,10 +1132,10 @@ foreach my $t (@files) { @cc = (@initial_cc, @cc); - send_message(); + my $message_was_sent = send_message(); # set up for the next message - if ($chain_reply_to || !defined $reply_to || length($reply_to) == 0) { + if ($message_was_sent and $chain_reply_to || not defined $reply_to || length($reply_to) == 0) { $reply_to = $message_id; if (length $references > 0) { $references .= "\n $message_id"; From bec99cfc679b8c754ddd03feeb691b4c054ccc6a Mon Sep 17 00:00:00 2001 From: Michael Witten Date: Mon, 13 Apr 2009 13:23:52 -0500 Subject: [PATCH 6/6] send-email: Remove superfluous `my $editor = ...' Not only was it a repeat, but it also had no effect. Signed-off-by: Michael Witten Signed-off-by: Junio C Hamano --- git-send-email.perl | 2 -- 1 file changed, 2 deletions(-) diff --git a/git-send-email.perl b/git-send-email.perl index 43f956b780..04267c58dd 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -544,8 +544,6 @@ EOT } close(C); - my $editor = $ENV{GIT_EDITOR} || Git::config(@repo, "core.editor") || $ENV{VISUAL} || $ENV{EDITOR} || "vi"; - if ($annotate) { do_edit($compose_filename, @files); } else {