Skip to content

Instantly share code, notes, and snippets.

View tehshane's full-sized avatar

Shane Lawrence tehshane

View GitHub Profile
@tehshane
tehshane / pre-commit
Last active May 29, 2019 23:24 — forked from kuy/pre-commit
git: pre-commit hook script to prevent committing FIXME code
#!/bin/sh
matches=$(git diff --cached | grep -E '\+.*?\/\/\s?(DEBUG|FIXME|debugger\;)')
if [ "$matches" != "" ]
then
echo "Detected possible debug-only code."
echo "Are you sure you want to commit it?"
echo " ${matches}"
exit 1