Created
January 23, 2024 09:05
-
-
Save zing-rsa/f12e83a9c9ecd56b2365d5579c8e622e to your computer and use it in GitHub Desktop.
Revisions
-
zing-rsa created this gist
Jan 23, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/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 # read flag read -p "[pre-commit hook] TODO detected in patch, abort commit? (Y/n) " yn # close stdin exec <&- case $yn in [Nn] ) exit 0;; * ) die "[pre-commit hook] Commit blocked";; esac fi