Last active
August 29, 2015 14:04
-
-
Save sadfuzzy/a0efa7a9a7685c82da65 to your computer and use it in GitHub Desktop.
Add branch name (and description) at the beginning of commit message
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
# Automatically adds branch name and description to every commit message. | |
# | |
DESCRIPTION=$(git config branch."$NAME".description) | |
if ! [[ $@ == *HEAD* ]] then | |
NAME=$(git branch | grep '*' | sed 's/* //') | |
echo "$NAME"': '"`cat "$1"`" > "$1" | |
fi | |
if [ -n "$DESCRIPTION" ] then | |
echo "" >> "$1" | |
echo $DESCRIPTION >> "$1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment