Skip to content

Instantly share code, notes, and snippets.

@iamleeg
Last active December 11, 2015 15:18
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamleeg/4620038 to your computer and use it in GitHub Desktop.
Save iamleeg/4620038 to your computer and use it in GitHub Desktop.
A quick and dirty pre-commit hook to let me flag code that shouldn't be committed.
#!/bin/bash
git diff --cached -SNSLog --quiet
if [ $? -eq 1 ]; then
echo "NSLog call detected, indicating debug code is staged. Please unstage your debug code."
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment