Skip to content

Instantly share code, notes, and snippets.

@Smosker Smosker/commit-msg
Last active Oct 20, 2017

Embed
What would you like to do?
cd .git
!/bin/sh
NAME=$(git branch | grep '*' | grep -o "[A-Z0-9-]\+")
DESCRIPTION=$(git config branch."$NAME".description)
TEXT=$(cat "$1" | sed '/^#.*/d')
if [ -n "$TEXT" ]
then
echo "$NAME"' '$(cat "$1" | sed '/^#.*/d') > "$1"
if [ -n "$DESCRIPTION" ]
then
echo "" >> "$1"
echo $DESCRIPTION >> "$1"
fi
else
echo "Aborting commit due to empty commit message."
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.