irc-announce: colorize diff --stat

This commit is contained in:
tv 2015-09-28 00:39:45 +02:00
parent f157040338
commit 22b430f1b4

View File

@ -167,8 +167,18 @@ let
message=''${message+$message
}$(
git log --format='%h %ar: %s ' $id2..$id
git diff --stat $id2..$id
green() { printf '\x0303,99%s\x0F' "$1"; }
red() { printf '\x0304,99%s\x0F' "$1"; }
orange() { printf '\x0307,99%s\x0F' "$1"; }
gray() { printf '\x0314,99%s\x0F' "$1"; }
git log --format="$(orange %h) %s $(gray '(%ar)')" $id2..$id
git diff --stat $id2..$id \
| sed '
$!s/+/'$(green '&')'/g
$!s/-/'$(red '&')'/g
'
)
done