Skip to content

Instantly share code, notes, and snippets.

@Fedalto
Created September 10, 2013 19:16
Show Gist options
  • Save Fedalto/6514230 to your computer and use it in GitHub Desktop.
Save Fedalto/6514230 to your computer and use it in GitHub Desktop.
Pre-commit git hook
#!/bin/sh
if git-rev-parse --verify HEAD >/dev/null 2>&1; then
against=HEAD
else
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
for FILE in `git diff-index --check --name-status $against -- | cut -c3-` ; do
# Check if the file contains 'debugger'
if [ "grep 'pdb.set_trace' $FILE" ]
then
echo $FILE ' contains debugger!'
exit 1
fi
done
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment