Skip to content

Instantly share code, notes, and snippets.

@badsyntax
Created May 13, 2010 10:39
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 badsyntax/399710 to your computer and use it in GitHub Desktop.
Save badsyntax/399710 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# example commit-msg hook to prevent commit messages with less than 20 characters
message=`cat $1`
message_length=`echo ${#message}`
if [ $message_length -lt 20 ]; then
echo "Commit failed. The commit message is less than 20 characters. (length is $message_length)"
exit 1
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment