Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A git commit hook runner, for running multiple commit scripts
# Collection of pre-commit hooks
set -e
# Get directory of script file
if [ -h ${ME} ]; then
# dereference if it is a symlink (hint: OS X does not support readlink -f)
ME=`readlink $0`
# Ideally this should happen, but it makes files look changed in
# Emacs, which is super annoying.
# git stash -q --keep-index
# trap "git stash pop -q" EXIT
BINDIR=$(dirname ${ME})
# Run checks
${BINDIR}/ $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment