-
-
Save dryaz/6e55f55ffad6aeb188032e9481f78a45 to your computer and use it in GitHub Desktop.
commit-msg hook script
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 | |
# | |
# Automatically adds branch name and branch description to every commit message. | |
# | |
NAME=$(git branch | grep '*' | sed 's/*.*\///') | |
DESCRIPTION=$(git config branch."$NAME".description) | |
echo "$NAME: $(cat $1)" > "$1" | |
if [ -n "$DESCRIPTION" ] | |
then | |
echo "" >> "$1" | |
echo $DESCRIPTION >> "$1" | |
fi | |
echo "" >> "$1" | |
echo "Issue in tracker" >> "$1" | |
# Change issueTrackerBaseUrl to your base url to task tracker. | |
echo "https://{issueTrackerBaseUrl}/$NAME" >> "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment