-
-
Save akarasz/32179289684eaf574ad88f0dd07b4529 to your computer and use it in GitHub Desktop.
Cussing-free git commits - https://akarasz.me/2023/03/cussing-free-git-commits/
This file contains 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 characters
fudge | |
dookie | |
butt |
This file contains 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 characters
#!/bin/bash | |
CUSS_WORDS="/foo/bar/no-no.txt" | |
if git diff --cached | grep -if $CUSS_WORDS >/dev/null; then | |
echo "cuss words detected! abort commit" | |
exit 1 | |
fi | |
if [ -f .git/hooks/pre-commit ]; then | |
.git/hooks/./pre-commit | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment