Skip to content

Instantly share code, notes, and snippets.

@aaronjorbin
Forked from nacin/gist:2323060
Created April 7, 2012 04:57
Show Gist options
  • Save aaronjorbin/2325308 to your computer and use it in GitHub Desktop.
Save aaronjorbin/2325308 to your computer and use it in GitHub Desktop.
Nacin's SVN override
# SVN override to prevent commits that try to implicitly commit more than one file.
# Has weaned me off of svn ci -m very effectively. I now almost always use svn ci,
# which usually results in me writing longer and more helpful commit messages.
# Also, it prevents me from committing unrelated code, so there's that.
function svn() {
if [ "$1" == "ci" ] && [ "$2" == "-m" ] && [ -z "$4" ] && [ "$(svn stat --ignore-externals | grep '^[^?X]' | wc -l | awk '{print $1}')" -gt 1 ]; then
svn stat --ignore-externals | grep '^[^?X]'
echo ""
echo $3
echo ""
echo "Unbounded commit... What are you doing, man?"
elif [ "$1" == "ci" ] && ["$(svn diff | grep 'var_dump')"]; then
echo ""
echo "var_dump detected dogg"
echo ""
elif [ "$1" == "ci" ] && ["$(svn diff | grep 'console.log')"]; then
echo ""
echo "console.log detected man"
echo ""
else
/usr/bin/svn "$@"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment