-
-
Save aaronjorbin/2325308 to your computer and use it in GitHub Desktop.
Nacin's SVN override
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
# 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