summaryrefslogtreecommitdiffstats
path: root/lib/git.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git.nix')
-rw-r--r--lib/git.nix25
1 files changed, 15 insertions, 10 deletions
diff --git a/lib/git.nix b/lib/git.nix
index b28d89413..978fabba8 100644
--- a/lib/git.nix
+++ b/lib/git.nix
@@ -47,12 +47,13 @@ let
gawk
gnused
netcat
+ nettools
])}
- IRC_SERVER="$1"
- IRC_PORT="$2"
- IRC_NICK="$3"
- IRC_CHANNEL="$4"
+ IRC_SERVER=$1
+ IRC_PORT=$2
+ IRC_NICK=$3$$
+ IRC_CHANNEL=$4
message=$5
export IRC_CHANNEL # for privmsg_cat
@@ -138,15 +139,19 @@ let
# empty_tree=$(git hash-object -t tree /dev/null
empty_tree=4b825dc6
- id=$(echo $oldrev | cut -b-7)
- id2=$(echo $newrev | cut -b-7)
- if [ $oldrev = $empty ]; then id=$empty_tree; fi
- if [ $newrev = $empty ]; then id2=$empty_tree; fi
+ id=$(echo $newrev | cut -b-7)
+ id2=$(echo $oldrev | cut -b-7)
+ if [ $newrev = $empty ]; then id=$empty_tree; fi
+ if [ $oldrev = $empty ]; then id2=$empty_tree; fi
case $receive_mode in
create)
#git log --oneline $id2
- link="http://cd/cgit/$GIT_SSH_REPO/"
+ link="http://cd/cgit/$GIT_SSH_REPO/?h=$h"
+ ;;
+ delete)
+ #git log --oneline $id2
+ link="http://cd/cgit/$GIT_SSH_REPO/ ($h)"
;;
fast-forward|non-fast-forward)
#git diff --stat $id..$id2
@@ -157,7 +162,7 @@ let
#host=$nick
#$host $GIT_SSH_REPO $ref $link
message="''${message+$message
- }$GIT_SSH_USER $receive_mode pushed $link"
+ }$GIT_SSH_USER $receive_mode $link"
done
if test -n "''${message-}"; then