summaryrefslogtreecommitdiffstats
path: root/tv/4lib/git.nix
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-09-28 00:39:45 +0200
committertv <tv@shackspace.de>2015-09-28 00:54:40 +0200
commit22b430f1b4826c02c7d460dbabb3f2b77d286d2e (patch)
tree8c2aac07acb71a38034052600d236d654e63ada7 /tv/4lib/git.nix
parentf1570403382453a6e54e38ec156a4cd3ce9ebb2d (diff)
irc-announce: colorize diff --stat
Diffstat (limited to 'tv/4lib/git.nix')
-rw-r--r--tv/4lib/git.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/tv/4lib/git.nix b/tv/4lib/git.nix
index 75d69efe1..7dbcf72b2 100644
--- a/tv/4lib/git.nix
+++ b/tv/4lib/git.nix
@@ -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