Created
May 30, 2012 09:34
-
-
Save brianjriddle/2835110 to your computer and use it in GitHub Desktop.
git post commit hook to trigger if commit message has a key word that starts with %
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 | |
#will priint out a message if a commit contains a keyword prefixed with % | |
# | |
MARKERS="%\w+" | |
RELEASE=$(git log $(git reflog -n 1 | cut -d ":" -f1) | grep -Pio "$MARKERS"| sort -fu | tr '\n' ' ') | |
if [ "$RELEASE" != "" ]; | |
then | |
echo "**************************************************************" | |
echo " NEED to RELEASE \033[1;31m$RELEASE\033[00m before releasing $(basename $(pwd))" | |
echo "**************************************************************" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment