Skip to content

Instantly share code, notes, and snippets.

@ffffranklin
Forked from kuy/pre-commit
Created August 3, 2018 21:00
Show Gist options
  • Save ffffranklin/b7d7ae044cfb373b64075cdc31372f5f to your computer and use it in GitHub Desktop.
Save ffffranklin/b7d7ae044cfb373b64075cdc31372f5f 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