summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortv <tv@shackspace.de>2015-09-28 01:29:36 +0200
committertv <tv@shackspace.de>2015-09-28 01:29:36 +0200
commitac49bcab3d7776b2e17475fbaaa927b1a7d1c279 (patch)
tree96034a500c6e5ec2bf36728b7dc4e7657ed444fa
parentffa024c95025862d4498faed453ae34ca02b7582 (diff)
irc-announce: add add_message
-rw-r--r--tv/4lib/git.nix15
1 files changed, 9 insertions, 6 deletions
diff --git a/tv/4lib/git.nix b/tv/4lib/git.nix
index f99bcc967..748b77269 100644
--- a/tv/4lib/git.nix
+++ b/tv/4lib/git.nix
@@ -120,6 +120,12 @@ let
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}
@@ -130,7 +136,6 @@ let
empty=0000000000000000000000000000000000000000
- unset message
while read oldrev newrev ref; do
if [ $oldrev = $empty ]; then
@@ -168,11 +173,9 @@ let
esac
#$host $GIT_SSH_REPO $ref $link
- message="''${message+$message
- }$(pink push) $link $(gray "($receive_mode)")"
+ add_message $(pink push) $link $(gray "($receive_mode)")
- message=''${message+$message
- }$(
+ add_message "$(
git log \
--format="$(orange %h) %s $(gray '(%ar)')" \
--reverse \
@@ -180,7 +183,7 @@ let
git diff --stat $id2..$id \
| sed '$!s/\(+*\)\(-*\)$/'$(green '\1')$(red '\2')'/'
- )
+ )"
done