Skip to content

Instantly share code, notes, and snippets.

Last active September 4, 2016 07:30
What would you like to do?
Deny commits to tags in a subversion repository via pre-commit hook.
# Save in `hooks/pre-commit` and `chmod +x hooks/pre-commit`
# source:
# Denies commits to tags with a pre-commit hook
# Committing to tags is not allowed
$SVNLOOK changed -t "${TXN}" "${REPOS}" | grep '^U\W*tags' && /bin/echo 'Cannot commit to tags!' 1>&2 && exit 1
# All checks passed, so allow the commit
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment