Created
June 4, 2015 21:36
-
-
Save malexw/de4ec5ba3b07beb6322a to your computer and use it in GitHub Desktop.
Reject git commits that have a commit message greater than 50 characters
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/sh | |
exec 1>&2 | |
char_count=$(cat $1 | wc -m) | |
if [ "$char_count" -gt "50" ] | |
then | |
echo "Aborting commit. Commit message too long (" $char_count "/ 50 chars )" | |
exit $char_count | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment