Skip to content

Instantly share code, notes, and snippets.

@mnalis
Forked from kuy/pre-commit
Created October 12, 2020 17:19
Show Gist options
  • Save mnalis/be654c4265b979b9633f316692833010 to your computer and use it in GitHub Desktop.
Save mnalis/be654c4265b979b9633f316692833010 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