diff options
author | lassulus <lass@aidsballs.de> | 2015-10-01 22:45:31 +0200 |
---|---|---|
committer | lassulus <lass@aidsballs.de> | 2015-10-01 22:45:31 +0200 |
commit | fea580ef0cf76b2cf75aaf2e2e8781e841dc0b63 (patch) | |
tree | b1e1d0a9824c3b243ae04e286db5770c5f3ad3ba /tv/4lib | |
parent | 1e410cd2329f15fc2f13c54f99eae102c09eb115 (diff) | |
parent | c08290763cc9e8e6015fd1cacad73b639d52aa6d (diff) |
Merge branch 'tv'
Diffstat (limited to 'tv/4lib')
-rw-r--r-- | tv/4lib/git.nix | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/tv/4lib/git.nix b/tv/4lib/git.nix index 748b7726..d8827115 100644 --- a/tv/4lib/git.nix +++ b/tv/4lib/git.nix @@ -1,7 +1,7 @@ { lib, pkgs, ... }: let - inherit (lib) addNames escapeShellArg makeSearchPath; + inherit (lib) addNames escapeShellArg makeSearchPath optionalString; commands = addNames { git-receive-pack = {}; @@ -104,7 +104,7 @@ let hooks = { # TODO make this a package? - irc-announce = { nick, channel, server, port ? 6667 }: '' + irc-announce = { nick, channel, server, port ? 6667, verbose ? false }: '' #! /bin/sh set -euf @@ -150,7 +150,7 @@ let h=$(echo $ref | sed 's:^refs/heads/::') - # empty_tree=$(git hash-object -t tree /dev/null + # empty_tree=$(git hash-object -t tree /dev/null) empty_tree=4b825dc6 id=$(echo $newrev | cut -b-7) @@ -160,11 +160,9 @@ let case $receive_mode in create) - #git log --oneline $id2 link="$cgit_endpoint/$GIT_SSH_REPO/?h=$h" ;; delete) - #git log --oneline $id2 link="$cgit_endpoint/$GIT_SSH_REPO/ ($h)" ;; fast-forward|non-fast-forward) @@ -175,15 +173,17 @@ let #$host $GIT_SSH_REPO $ref $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')'/' - )" + ${optionalString verbose '' + 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 |