Created
April 27, 2015 12:50
-
-
Save astery/3ee3023403854400168f to your computer and use it in GitHub Desktop.
Append branch number for every 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
#!/bin/bash | |
# | |
# Append issue number for every commit message | |
# | |
ISSUE_NO=$(git branch | grep -oP '(?<=\* issue\/)\d+') | |
APPEND="Task number: #$ISSUE_NO" | |
if [[ -n "$ISSUE_NO" ]]; then | |
MESSAGE=$(cat $1) | |
printf "%s\n\n%s" "$MESSAGE" "$APPEND" > $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment