Created
May 19, 2014 09:29
-
-
Save tgerulaitis/4bb87f55010a1a6fa70e to your computer and use it in GitHub Desktop.
A pre-commit hook that rejects any commits containing "dev_debug" or "var_dump" in the diff.
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/sh | |
# Check diff for debug statements | |
for file in $(git diff --cached --name-only); do \ | |
git diff --cached $file | grep -E '^\+.*(dev_debug|var_dump)' > /dev/null && \ | |
echo "COMMIT REJECTED: Debug statements found in $file" && \ | |
exit 1 | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment