Skip to content

Instantly share code, notes, and snippets.

@jlbruno
Created June 26, 2013 18:24
Show Gist options
  • Save jlbruno/5869970 to your computer and use it in GitHub Desktop.
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.
# 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
@jlbruno
Copy link
Author

jlbruno commented Jun 26, 2013

Thanks to @clavery for the cleverness of the second part

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment