Created
September 11, 2012 17:00
-
-
Save hannesstruss/3699834 to your computer and use it in GitHub Desktop.
Git PDB Pre Commit Hook
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
#!/bin/bash | |
git diff --cached | grep ^+ | grep 'pdb.set_trace()' > /dev/null | |
if [ $? = '0' ]; then | |
echo "You're about to commit code with pdb statements. Please remove them!" | |
echo "Run 'git diff --cached' to see what you're about to commit." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment