git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH] send-email: support coloring dry-run output
Date: Thu, 17 May 2012 20:16:36 +0700	[thread overview]
Message-ID: <1337260596-15498-1-git-send-email-pclouds@gmail.com> (raw)

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

             reply	other threads:[~2012-05-17 13:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-17 13:16 Nguyễn Thái Ngọc Duy [this message]
2012-05-17 14:27 ` [PATCH] send-email: support coloring dry-run output Angus Hammond
2012-05-18  4:26   ` Nguyen Thai Ngoc Duy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1337260596-15498-1-git-send-email-pclouds@gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).