Created
June 15, 2016 17:18
-
-
Save DiegoSalazar/0f4e81cb80c50128a890675b8d83bf4e to your computer and use it in GitHub Desktop.
git pre-commit hook to block changes containing the string debug in a ruby comment
This file contains hidden or 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 | |
| . git-sh-setup # for die | |
| git-diff-index -p -M --cached HEAD -- | grep '^+' | grep -n '# debug' && die 'Blocking commit: debug detected in code' | |
| : |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you so much for writing this!
Your Gist is ranked #1 for the Google search: