From 678f0a872cb7ed123529ff31bab0cf22666e242e Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 28 Sep 2015 00:02:45 +0200 Subject: irc-announce: show more stuff --- tv/4lib/git.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tv') diff --git a/tv/4lib/git.nix b/tv/4lib/git.nix index 2b25debdc..1d025f3cc 100644 --- a/tv/4lib/git.nix +++ b/tv/4lib/git.nix @@ -157,7 +157,6 @@ 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 @@ -165,6 +164,13 @@ let #$host $GIT_SSH_REPO $ref $link message="''${message+$message }$GIT_SSH_USER $receive_mode $link" + + message=''${message+$message + }$( + git log --format='%h %ar: %s ' $id..$id2 + git diff --stat $id..$id2 + ) + done if test -n "''${message-}"; then -- cgit v1.2.3 From f1570403382453a6e54e38ec156a4cd3ce9ebb2d Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 28 Sep 2015 00:31:19 +0200 Subject: irc-announce: show diff/log range --- tv/4lib/git.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tv') diff --git a/tv/4lib/git.nix b/tv/4lib/git.nix index 1d025f3cc..75d69efe1 100644 --- a/tv/4lib/git.nix +++ b/tv/4lib/git.nix @@ -167,8 +167,8 @@ let message=''${message+$message }$( - git log --format='%h %ar: %s ' $id..$id2 - git diff --stat $id..$id2 + git log --format='%h %ar: %s ' $id2..$id + git diff --stat $id2..$id ) done -- cgit v1.2.3 From 22b430f1b4826c02c7d460dbabb3f2b77d286d2e Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 28 Sep 2015 00:39:45 +0200 Subject: irc-announce: colorize diff --stat --- tv/4lib/git.nix | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'tv') 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 -- cgit v1.2.3 From c88a7d3be5d9a8ee748cb8bdfac97de3277e0d5e Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 28 Sep 2015 01:02:37 +0200 Subject: irc-announce: reverse git log --- tv/4lib/git.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tv') diff --git a/tv/4lib/git.nix b/tv/4lib/git.nix index 7dbcf72b2..fe6401728 100644 --- a/tv/4lib/git.nix +++ b/tv/4lib/git.nix @@ -172,7 +172,10 @@ let 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 log \ + --format="$(orange %h) %s $(gray '(%ar)')" \ + --reverse \ + $id2..$id git diff --stat $id2..$id \ | sed ' -- cgit v1.2.3 From ce731718eda4266bf09d45434d98418f5efd195a Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 28 Sep 2015 01:10:35 +0200 Subject: irc-announce: optimize diff --stat renderer --- tv/4lib/git.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'tv') diff --git a/tv/4lib/git.nix b/tv/4lib/git.nix index fe6401728..6f3654356 100644 --- a/tv/4lib/git.nix +++ b/tv/4lib/git.nix @@ -178,10 +178,7 @@ let $id2..$id git diff --stat $id2..$id \ - | sed ' - $!s/+/'$(green '&')'/g - $!s/-/'$(red '&')'/g - ' + | sed '$!s/\(+*\)\(-*\)$/'$(green '\1')$(red '\2')'/' ) done -- cgit v1.2.3 From ffa024c95025862d4498faed453ae34ca02b7582 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 28 Sep 2015 01:18:44 +0200 Subject: irc-announce: omit $GIT_SSH_USER --- tv/4lib/git.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tv') diff --git a/tv/4lib/git.nix b/tv/4lib/git.nix index 6f3654356..f99bcc967 100644 --- a/tv/4lib/git.nix +++ b/tv/4lib/git.nix @@ -114,6 +114,12 @@ 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"; } + nick=${escapeShellArg nick} channel=${escapeShellArg channel} server=${escapeShellArg server} @@ -163,15 +169,10 @@ let #$host $GIT_SSH_REPO $ref $link message="''${message+$message - }$GIT_SSH_USER $receive_mode $link" + }$(pink push) $link $(gray "($receive_mode)")" 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"; } - git log \ --format="$(orange %h) %s $(gray '(%ar)')" \ --reverse \ -- cgit v1.2.3 From ac49bcab3d7776b2e17475fbaaa927b1a7d1c279 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 28 Sep 2015 01:29:36 +0200 Subject: irc-announce: add add_message --- tv/4lib/git.nix | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'tv') 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 -- cgit v1.2.3