Deny commits to tags in a subversion repository via pre-commit hook. http://svnbook.red-bean.com/en/1.7/svn.ref.reposhooks.pre-commit.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Save in `hooks/pre-commit` and `chmod +x hooks/pre-commit` | |
# source: http://stackoverflow.com/a/576261 | |
# | |
# Denies commits to tags with a pre-commit hook | |
REPOS="${1}" | |
TXN="${2}" | |
SVNLOOK='/usr/bin/svnlook' | |
# 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