[PATCH v5 3/3] send-email: separate the confirmation prompts from the messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Emit additional vertical whitespace after the "Send this email [y/n/...]?"
confirmation prompts, more specifically after each confirmed email is sent,
but before the subsequent messages are emitted, to make the produced output
more readable.  The subsequent produced messages were bunched together with
the confirmation prompts, as visible in the sample output excerpt below,
which made discerning the outputs unnecessarily harder.

    ...
    Send this email? ([y]es|[n]o|[e]dit|[q]uit|[a]ll): y
    OK. Log says:
    ...

The introduced changes don't emit additional vertical whitespace after the
confirmation prompt if the user selects to skip sending the email they were
asked about, or if the user selects to quit the procedure entirely.  This
follows the Git's general approach of not wasting the vertical screen space
whenever reasonably possible.

The associated test, t9001, requires no updates to cover these changes.

Signed-off-by: Dragan Simic <dsimic@xxxxxxxxxxx>
---
 git-send-email.perl | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/git-send-email.perl b/git-send-email.perl
index 4127fbe6b936..a09bc7fd6b96 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1510,6 +1510,7 @@ sub gen_header {
 sub send_message {
 	my ($recipients_ref, $to, $date, $gitversion, $cc, $ccline, $header) = gen_header();
 	my @recipients = @$recipients_ref;
+	my $prompt_separator = 0;
 
 	my @sendmail_parameters = ('-i', @recipients);
 	my $raw_from = $sender;
@@ -1556,6 +1557,7 @@ sub send_message {
 			$confirm = 'never';
 			$needs_separator = 1;
 		}
+		$prompt_separator = 1;
 	} else {
 		$needs_separator = 1;
 	}
@@ -1665,6 +1667,7 @@ sub send_message {
 		$smtp->dataend() or die $smtp->message;
 		$smtp->code =~ /250|200/ or die sprintf(__("Failed to send %s\n"), $subject).$smtp->message;
 	}
+	print "\n" if ($prompt_separator);
 	if ($quiet) {
 		printf($dry_run ? __("Dry-Sent %s\n") : __("Sent %s\n"), $subject);
 	} else {




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux