diff options
author | makefu <github@syntax-fehler.de> | 2015-09-30 19:45:24 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-09-30 19:45:24 +0200 |
commit | e1ec3ff1efabf1e8ccd2f86f1cb8da6473c7ce49 (patch) | |
tree | 0ab0f7bb37ed72a4fd88c6baec3f124c522836e2 /tv | |
parent | d9f4d621bcde5ddc983a922e378657dba1f6e141 (diff) | |
parent | ac49bcab3d7776b2e17475fbaaa927b1a7d1c279 (diff) |
Merge remote-tracking branch 'cd/master'
Diffstat (limited to 'tv')
-rw-r--r-- | tv/4lib/git.nix | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/tv/4lib/git.nix b/tv/4lib/git.nix index 2b25debdc..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 @@ -157,14 +168,23 @@ let link="$cgit_endpoint/$GIT_SSH_REPO/ ($h)" ;; fast-forward|non-fast-forward) - #git diff --stat $id..$id2 link="$cgit_endpoint/$GIT_SSH_REPO/diff/?h=$h&id=$id&id2=$id2" ;; esac #$host $GIT_SSH_REPO $ref $link - message="''${message+$message - }$GIT_SSH_USER $receive_mode $link" + 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 '\1')$(red '\2')'/' + )" + done if test -n "''${message-}"; then |