Files
dotfiles/githooks/pre-commit
T

15 lines
225 B
Bash
Executable File

#!/bin/sh
# Redirect output to stderr.
exec 1>&2
diff=$(git diff --staged HEAD | grep -q TODO)
if [ -z "$diff" ]; then
exit 0;
else
echo "Please remove all TODOs before committing:"
echo "$diff"
exit 1;
fi