Last active
March 21, 2016 20:56
-
-
Save maxandron/e2016373bed0048555bf to your computer and use it in GitHub Desktop.
A git pre-commit hook to disallow committing code with "TODO"
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 | |
. git-sh-setup # For die | |
git diff --cached --name-status | | |
awk '$1 != "R" { print $2 }' | | |
xargs grep TODO --with-filename --line-number && | |
die Blocking commit - TODO detected in patch | |
exit 0 # Needed because this file must end with success code for git to continue |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment