[PATCH RFC3.5 07/12] send-email: Cleanup send_message 'log' code

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

 



Signed-off-by: Michael Witten <mfwitten@xxxxxxxxx>
---
 git-send-email.perl |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index 6e2ea2c..f3e2ccd 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1054,24 +1054,23 @@ X-Mailer: git-send-email $gitversion
 
 		die "Failed to send '$subject': " . $smtp->message . "\n";
 	}
-	if ($quiet) {
-		printf (($dry_run ? "Dry-" : "")."Sent %s\n", $subject);
+
+	print "\n" unless $quiet;
+	print 'Dry-' if $dry_run;
+	print("Sent $subject\n"), return 1 if $quiet;
+	print "OK. Log says:\n";
+
+	if ($smtp_server_is_a_command) {
+		print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
+		print "$header\n";
+		print "Result: OK\n";
 	} else {
-		print (($dry_run ? "Dry-" : "")."OK. Log says:\n");
-		unless ($smtp_server_is_a_command) {
-			print "Server: $smtp_server\n";
-			print "MAIL FROM:<$raw_from>\n";
-			print "RCPT TO:".join(',',(map { "<$_>" } @recipients))."\n";
-		} else {
-			print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
-		}
-		print $header, "\n";
-		if ($smtp) {
-			print "Result: ", $smtp->code, ' ',
-				($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
-		} else {
-			print "Result: OK\n";
-		}
+		print "Server: $smtp_server\n";
+		print "MAIL FROM:<$raw_from>\n";
+		print "RCPT TO:".join(',',(map { "<$_>" } @recipients))."\n";
+		print "$header\n";
+		print("Result: OK\n"), return 1 if $dry_run;
+		print "Result: ", $smtp->code, ' ', ($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
 	}
 
 	return 1;
-- 
1.6.2.2.479.g2aec

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]