Created
June 26, 2013 18:24
-
-
Save jlbruno/5869970 to your computer and use it in GitHub Desktop.
pre-commit hook for checking if someone is committing into a certain folder within a subversion repo, and telling them to move their commits elsewhere.
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
# Tell everyone to bugger off elsewhere | |
echo "THIS REPOSITORY HAS MOVED TO BITBUCKET" >&2 | |
echo "https://bitbucket.org/pixelmedia/bdc-website" >&2 | |
exit 1 | |
# OR | |
# Check where in the repo they are committing, before you tell them to bugger off | |
LINES=$(svnlook changed $REPOS -t $TXN) | |
FOLDER_NAME="web-template/" | |
for line in $LINES | |
do | |
if [[ "$line" == *"$FOLDER_NAME"* ]] | |
then | |
echo "This has moved to bitbucket" >&2 | |
echo "https://bitbucket.org/REPO-PATH" >&2 | |
exit 1 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks to @clavery for the cleverness of the second part