All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] send-email: support coloring dry-run output
@ 2012-05-17 13:16 Nguyễn Thái Ngọc Duy
  2012-05-17 14:27 ` Angus Hammond
  0 siblings, 1 reply; 3+ messages in thread
From: Nguyễn Thái Ngọc Duy @ 2012-05-17 13:16 UTC (permalink / raw)
  To: git; +Cc: Nguyễn Thái Ngọc Duy

It highlights sendmail command and subject lines. The most important
lines to me.

I'm no Perl expert. This patch is by no means for submission. But
maybe it'll motivate someone to do a proper patch.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 git-send-email.perl |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/git-send-email.perl b/git-send-email.perl
index ef30c55..033ca5e 100755
--- a/git-send-email.perl
+++ b/git-send-email.perl
@@ -1157,9 +1157,13 @@ X-Mailer: git-send-email $gitversion
 			    print "RCPT TO:<$entry>\n";
 			}
 		} else {
+			print color 'yellow';
 			print "Sendmail: $smtp_server ".join(' ',@sendmail_parameters)."\n";
+			print color 'reset';
 		}
-		print $header, "\n";
+		my $colored_header = $header;
+		$colored_header =~ s/^(Subject: .*)/color("bold").$1.color("reset")/em;
+		print $colored_header, "\n";
 		if ($smtp) {
 			print "Result: ", $smtp->code, ' ',
 				($smtp->message =~ /\n([^\n]+\n)$/s), "\n";
-- 
1.7.8.36.g69ee2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-18  4:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-17 13:16 [PATCH] send-email: support coloring dry-run output Nguyễn Thái Ngọc Duy
2012-05-17 14:27 ` Angus Hammond
2012-05-18  4:26   ` Nguyen Thai Ngoc Duy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.