8 # We only care about branches moving--ignore tags/etc.
11 short_refname=${refname##refs/heads/}
19 excused=" $(git config hooks.update-ensure-ticket-reference.excused) "
20 if [[ $excused =~ " $short_refname " ]] ; then
24 if expr "$oldrev" : '0*$' >/dev/null ; then
25 git rev-parse --not --branches | git rev-list --stdin --no-merges $newrev
27 git rev-parse --not --branches | git rev-list --stdin --no-merges $oldrev..$newrev
28 fi | while read commit ; do
29 # Have log dump the "subject line, new line, body" of each commit message for grepping
30 git log -n 1 '--pretty=format:%s%n%b' "$commit" | grep -i '\(\(re\|refs\|qa\) #[0-9]\+\)\|\(no ticket\)' > /dev/null
31 if [ $? -ne 0 ] ; then
32 echo "----------------------------------------------------" >&2
34 echo "Commit $commit does not reference a ticket" >&2
36 echo "----------------------------------------------------" >&2