From 625d1beff94383d32b55fc468137908edacb4293 Mon Sep 17 00:00:00 2001 From: KatolaZ Date: Fri, 21 Jul 2017 07:23:43 +0100 Subject: first version of post-receive (with debug info) --- hooks/post-receive | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100755 hooks/post-receive (limited to 'hooks/post-receive') diff --git a/hooks/post-receive b/hooks/post-receive new file mode 100755 index 0000000..2bffd83 --- /dev/null +++ b/hooks/post-receive @@ -0,0 +1,39 @@ +#!/bin/sh + +SCORSH_CFG="scorsh" +SCORSH_VAR="scorsh.spooldir" + +while read old_value new_value ref; do + echo "arguments: ${old_value} ${new_value} ${ref} " + msg=$(git cat-file -p ${ref}) + + echo "Got reference:" + printf "$msg" + echo + echo "------" + + repo=$(pwd) + branch=$(echo ${ref} | sed -r -e 's:refs/heads/::g') + now=$(date +%s) + id="${new_value}_${now}" + + spool_dir=$(git config -f ${SCORSH_CFG} ${SCORSH_VAR}) + echo "id: ${id}" + echo "repo: ${repo}" + echo "branch: ${branch}" + echo "old_rev: ${old_value}" + echo "new_rev: ${new_value}" + echo "spool_dir: ${spool_dir}" +done + +cat <${spool_dir}/${id} + + -- cgit v1.2.3