Skip to content

Instantly share code, notes, and snippets.

@cGuille
Last active May 10, 2016 11:48
Show Gist options
  • Save cGuille/2307c9f385e38377e628404178909b9b to your computer and use it in GitHub Desktop.
Save cGuille/2307c9f385e38377e628404178909b9b to your computer and use it in GitHub Desktop.
Git post-commit hook to display the commit message in an enclosing sentence. The goal is to check whether the commit message wording feels right or not.
#!/usr/bin/env bash
LIGHT_GREEN='\e[1;32m'
NO_FORMAT='\e[0m'
UNDERLINE='\e[4m'
RESET_UNDERLINE='\e[24m'
COMMIT_MESSAGE="$(git show -s --format=%s HEAD)"
echo -e "${LIGHT_GREEN}When applied, this commit will ${UNDERLINE}${COMMIT_MESSAGE}${RESET_UNDERLINE}.${NO_FORMAT}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment