Skip to content

Instantly share code, notes, and snippets.

View zing-rsa's full-sized avatar

zing zing-rsa

View GitHub Profile
@zing-rsa
zing-rsa / pre-commit
Created January 23, 2024 09:05
Pre-commit hook that prompts before commiting changes containing the word "TODO"
#!/bin/sh
. git-sh-setup # for die
if git-diff-index -p -M --cached HEAD -- \
| grep '^+' \
| grep -i TODO; then
# assign stdin to allow read
exec < /dev/tty