diff options
author | lassulus <lass@aidsballs.de> | 2015-10-01 14:48:51 +0200 |
---|---|---|
committer | lassulus <lass@aidsballs.de> | 2015-10-01 14:48:51 +0200 |
commit | 4bacf702b0112a82eb2a4a21ee41c6f11337e8dc (patch) | |
tree | dc2f0e90f9336ba224384c81376ea0c2af2634c0 /tv/4lib | |
parent | a34de6743a44760d21589d4e1a154ccc5c621420 (diff) | |
parent | 3384dd0a5578cc3a26dd076669dd264f5ae9f008 (diff) |
Merge branch 'tv'
Diffstat (limited to 'tv/4lib')
-rw-r--r-- | tv/4lib/git.nix | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/tv/4lib/git.nix b/tv/4lib/git.nix index fe6401728..748b77269 100644 --- a/tv/4lib/git.nix +++ b/tv/4lib/git.nix @@ -114,6 +114,18 @@ let gnused ])} + green() { printf '\x0303,99%s\x0F' "$1"; } + red() { printf '\x0304,99%s\x0F' "$1"; } + orange() { printf '\x0307,99%s\x0F' "$1"; } + pink() { printf '\x0313,99%s\x0F' "$1"; } + gray() { printf '\x0314,99%s\x0F' "$1"; } + + unset message + add_message() { + message="''${message+$message + }$*" + } + nick=${escapeShellArg nick} channel=${escapeShellArg channel} server=${escapeShellArg server} @@ -124,7 +136,6 @@ let empty=0000000000000000000000000000000000000000 - unset message while read oldrev newrev ref; do if [ $oldrev = $empty ]; then @@ -162,27 +173,17 @@ let esac #$host $GIT_SSH_REPO $ref $link - message="''${message+$message - }$GIT_SSH_USER $receive_mode $link" - - message=''${message+$message - }$( - 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"; } + add_message $(pink push) $link $(gray "($receive_mode)") + add_message "$( git log \ --format="$(orange %h) %s $(gray '(%ar)')" \ --reverse \ $id2..$id git diff --stat $id2..$id \ - | sed ' - $!s/+/'$(green '&')'/g - $!s/-/'$(red '&')'/g - ' - ) + | sed '$!s/\(+*\)\(-*\)$/'$(green '\1')$(red '\2')'/' + )" done |