Skip to content

Instantly share code, notes, and snippets.

@ChrisLeNeve
Last active March 17, 2020 10:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisLeNeve/d734cb95e0c6e2a6aa517c440af42764 to your computer and use it in GitHub Desktop.
Save ChrisLeNeve/d734cb95e0c6e2a6aa517c440af42764 to your computer and use it in GitHub Desktop.
git pre commit hook - blocking added accents and bad characters
#!/bin/bash
echo "Checking your changes..."
#Whatever characters you want here, in the grep
if git diff --cached origin/stage *.html | grep -c 'é\|è\|ô'
then
echo "Impending doom shall be thy fate, o vilainous junior dev! Banish from thy work these monstrosities, or live to see thy kin demolished"
exit 1
fi
echo "Well; thou hast not added horrid characters to thy code. Thou shalt live to see another day, o valorous developer"
@ChrisLeNeve
Copy link
Author

chmod +x .git/hooks/pre-commit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment