Skip to content

Instantly share code, notes, and snippets.

@adnils
Forked from kuy/pre-commit
Created April 20, 2016 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adnils/c30663f1c5c8a3c4aed40e9915ae965b to your computer and use it in GitHub Desktop.
Save adnils/c30663f1c5c8a3c4aed40e9915ae965b to your computer and use it in GitHub Desktop.
git: pre-commit hook script to prevent committing FIXME code
#!/bin/sh
matches=$(git diff --cached | grep -E '\+.*?FIXME')
if [ "$matches" != "" ]
then
echo "'FIXME' tag is detected."
echo "Please fix it before committing."
echo " ${matches}"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment