Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # 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.
- #
- # Also checks for error_log, var_dump, and console.log, and rejects these commits.
- 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?"
- return
- elif [ "$1" == "ci" ] && [ "$(svn diff | grep -E '^\+.*(error_log|var_dump|console\.log)' | wc -l | awk '{print $1}')" -gt 0 ]; then
- echo "You left in some debug cruft."
- return
- fi
- /usr/bin/svn "$@"
- }
Add Comment
Please, Sign In to add comment