git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] send-email: support coloring dry-run output

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
May 17, 2012, 13:16 UTC
Message-ID
<1337260596-15498-1-git-send-email-pclouds@gmail.com>

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
Next: Angus Hammond
Message 1 of 3 in “send-email: support coloring dry-run output”
  1. send-email: support coloring dry-run outputNguyễn Thái Ngọc Duy, May 17, 2012
  2. Angus HammondMay 17, 2012
  3. Nguyen Thai Ngoc DuyMay 18, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.