-
-
Save stanislaw/b24f0ad39f508b747ad61a437ddef3e6 to your computer and use it in GitHub Desktop.
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 | |
# | |
# Converts branch name 'MAPP-452_how-is-it-going' into a commit message 'MAPP-452 How is it going' | |
# | |
if ! [ -z $2 ] | |
then | |
if ! [ "message" == $2 ] | |
then | |
exit | |
fi | |
fi | |
branchname=$(git branch | grep ^* | sed 's/\* //g' | sed 's/f\///g') | |
if ! [[ "$branchname" == MAPP-* ]] | |
then | |
exit | |
fi | |
original=`cat $1` | |
echo $branchname | awk -F_ '{ gsub("-", " ", $2); print "["$1"] " toupper(substr($2, 1, 1)) substr($2, 2, length($2)) }' > $1 | |
echo "$original" >> $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment