Last active
July 15, 2019 09:49
-
-
Save whalemare/a838e991b5c5203242cb6c75ec535f73 to your computer and use it in GitHub Desktop.
Add link to redmine ticket by working branch name
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
message=$(cat "$1") | |
currentBranch=$(git rev-parse --abbrev-ref HEAD) | |
currentBranch=$(echo "$currentBranch" | grep -o '[a-zA-Zа-яА-Я]\+-\d*') | |
echo "current ticket = $currentBranch" | |
countTrackerWords=$(echo "$message" | grep -w -c Tracker) | |
if [ $countTrackerWords == 0 ] && [ ! -z $currentBranch ] | |
then { | |
echo "" | |
echo "Redmine:" | |
echo "refs $currentBranch" | |
} >> "$1" | |
fi |
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
message=$(cat "$1") | |
currentBranch=$(git rev-parse --abbrev-ref HEAD) | |
currentBranch=$(echo "$currentBranch" | grep -o '[a-zA-Zа-яА-Я]\+-\d*') | |
echo "current ticket = $currentBranch" | |
countTrackerWords=$(echo "$message" | grep -w -c Tracker) | |
if [ $countTrackerWords == 0 ] && [ ! -z $currentBranch ] | |
then { | |
echo "" | |
echo "Tracker:" | |
echo "$currentBranch" | |
} >> "$1" | |
fi |
Author
whalemare
commented
Jul 8, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment