{"thread":{"id":"30547","subject":"[PATCH] send-email: support coloring dry-run output","startedAt":"2012-05-17T13:16:36Z","lastAt":"2012-05-18T04:26:57Z","messageCount":3,"participants":["Nguyễn Thái Ngọc Duy","Angus Hammond","Nguyen Thai Ngoc Duy"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"191625","messageId":"1337260596-15498-1-git-send-email-pclouds@gmail.com","threadId":"30547","inReplyTo":null,"subject":"[PATCH] send-email: support coloring dry-run output","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-05-17T13:16:36Z","receivedAt":"2012-05-17T13:16:36Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"It highlights sendmail command and subject lines. The most important\nlines to me.\n\nI'm no Perl expert. This patch is by no means for submission. But\nmaybe it'll motivate someone to do a proper patch.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n git-send-email.perl |    6 +++++-\n 1 files changed, 5 insertions(+), 1 deletions(-)\n\ndiff --git a/git-send-email.perl b/git-send-email.perl\nindex ef30c55..033ca5e 100755\n--- a/git-send-email.perl\n+++ b/git-send-email.perl\n@@ -1157,9 +1157,13 @@ X-Mailer: git-send-email $gitversion\n \t\t\t    print \"RCPT TO:<$entry>\\n\";\n \t\t\t}\n \t\t} else {\n+\t\t\tprint color 'yellow';\n \t\t\tprint \"Sendmail: $smtp_server \".join(' ',@sendmail_parameters).\"\\n\";\n+\t\t\tprint color 'reset';\n \t\t}\n-\t\tprint $header, \"\\n\";\n+\t\tmy $colored_header = $header;\n+\t\t$colored_header =~ s/^(Subject: .*)/color(\"bold\").$1.color(\"reset\")/em;\n+\t\tprint $colored_header, \"\\n\";\n \t\tif ($smtp) {\n \t\t\tprint \"Result: \", $smtp->code, ' ',\n \t\t\t\t($smtp->message =~ /\\n([^\\n]+\\n)$/s), \"\\n\";\n-- \n1.7.8.36.g69ee2\n"},{"id":"191626","messageId":"CAOBOgRaEnFOJ9=ZHczAq_TNerrrMciG8g0SHYDiKrqfhASU-iA@mail.gmail.com","threadId":"30547","inReplyTo":"1337260596-15498-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] send-email: support coloring dry-run output","fromName":"Angus Hammond","fromEmail":"angusgh@gmail.com","sentAt":"2012-05-17T14:27:40Z","receivedAt":"2012-05-17T14:27:40Z","isPatch":true,"sender":{"key":"angusgh@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1839397?v=4"},"body":"This seems like it would be a useful patch for those of us using sendmail.\nI'll admit I don't know any perl at all, but one bit seems a little\nodd to me. Is there a reason you use 3 separate print statements to\ndeal with the colours on the Sendmail line, but a regex substitution\nthe second time? I have no idea which would be considered the better\npractice but surely we should pick one and be consistent? Unless\nthere's some difference between the two that I'm missing.\nThanks\nAngus\n"},{"id":"191644","messageId":"CACsJy8D=O81cFu0X1g7J++bBaadObkfJ2rsV_WUfDpVrEYotTA@mail.gmail.com","threadId":"30547","inReplyTo":"CAOBOgRaEnFOJ9=ZHczAq_TNerrrMciG8g0SHYDiKrqfhASU-iA@mail.gmail.com","subject":"Re: [PATCH] send-email: support coloring dry-run output","fromName":"Nguyen Thai Ngoc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2012-05-18T04:26:57Z","receivedAt":"2012-05-18T04:26:57Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Thu, May 17, 2012 at 9:27 PM, Angus Hammond <angusgh@gmail.com> wrote:\n> This seems like it would be a useful patch for those of us using sendmail.\n> I'll admit I don't know any perl at all, but one bit seems a little\n> odd to me. Is there a reason you use 3 separate print statements to\n> deal with the colours on the Sendmail line, but a regex substitution\n> the second time? I have no idea which would be considered the better\n> practice but surely we should pick one and be consistent? Unless\n> there's some difference between the two that I'm missing.\n\nNo reasons. It was what I had in mind at that time and it worked, so I\ndid not bother cleaning up or anything.\n-- \nDuy\n"}]}