Sha256: 30d306170e3d2a76f9cb544bc256c2ec83099166bf312a3dc4adc06abe8529da

Contents?: true

Size: 1.23 KB

Versions: 4

Compression:

Stored size: 1.23 KB

Contents

#!/bin/sh
#
# An example hook script for the post-receive event
#
# This script is run after receive-pack has accepted a pack and the
# repository has been updated.  It is passed arguments in through stdin
# in the form
#  <oldrev> <newrev> <refname>
# For example:
#  aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
#
# see contrib/hooks/ for an sample, or uncomment the next line (on debian)
#


TRAC_ENV="YOUR TRAC ENV HERE"
LOG="/dev/null"
echo "in git post commit: $TRAC_ENV" | cat >>$LOG

while read oval nval ref ; do
    if expr "$oval" : '0*$' >/dev/null
    then
        git-rev-list "$nval"
    else
        git-rev-list "$nval" "^$oval"
    fi | while read com ; do
	echo "posting a comment to trac" | cat >>$LOG
	/usr/bin/python /usr/share/trac/contrib/trac-post-commit.py \
	    -p "$TRAC_ENV" \
	    -r "$com" \
	    -u "$(git-rev-list -n 1 $com --pretty=format:%an | sed '1d')" \
	    -m  "$(git-rev-list -n 1 $com --pretty=medium | sed '1,3d;s:^    ::')"
	echo "DONE posting a comment to trac" | cat >>$LOG
    done
done

echo "Done with trac commit hook: $TRAC_ENV" | cat >>$LOG

git reset --hard 
echo "resetting repo working copy" | cat >>$LOG

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
keithsalisbury-subtrac-0.1.1 lib/subtrac/trac-plugins/timingandestimationplugin/scripts/git-post-receive
keithsalisbury-subtrac-0.1.2 lib/subtrac/trac-plugins/timingandestimationplugin/scripts/git-post-receive
keithsalisbury-subtrac-0.1.3 lib/subtrac/trac-plugins/timingandestimationplugin/scripts/git-post-receive
keithsalisbury-subtrac-0.1.4 lib/subtrac/trac-plugins/timingandestimationplugin/scripts/git-post-receive