Last active
March 26, 2018 19:20
-
-
Save serhalp/4426b317cbe39b456c12 to your computer and use it in GitHub Desktop.
Pre-populate Git commit message with current branch's Pivotal Tracker story ID
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 | |
TMP=`git rev-parse --abbrev-ref HEAD | grep -o '[-_]\d\+$'` | |
STORY_ID=${TMP:1} | |
if [[ ! -z $STORY_ID ]] | |
then | |
ORIG_MSG_FILE="$1" | |
ORIG_MSG=`cat $1` | |
(echo "[#$STORY_ID]") > "$ORIG_MSG_FILE" | |
(echo "$ORIG_MSG") >> "$ORIG_MSG_FILE" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That is my version