diff options
author | KatolaZ <katolaz@freaknet.org> | 2017-07-21 07:23:43 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2017-07-21 07:23:43 +0100 |
commit | 625d1beff94383d32b55fc468137908edacb4293 (patch) | |
tree | 3722c858d729bee0b82c4138e28f03fa9edbc7e0 /hooks | |
parent | 001bcbdbfff95a3edcdae21b687f58c2628116f9 (diff) |
first version of post-receive (with debug info)
Diffstat (limited to 'hooks')
-rwxr-xr-x | hooks/post-receive | 39 |
1 files changed, 39 insertions, 0 deletions
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 <<EOF +--- +m_id: $id +m_repo: $repo +m_branch: $branch +m_oldrev: ${old_value} +m_newrev: ${new_value} +... +EOF>${spool_dir}/${id} + + |