I am writing a pre-receive hook for Git. This is the one where if multiple commits are pushed, and any one of them fail, then the whole push fails. Which is what I want.
while read old new ref; do [[ $new = *[^0]* ]] && news="$news $new" done git rev-list $news --not --all
This will avoid things like fastforwards over previously-pushed commits triggering wasted revalidation of unchanged content.