Last active
November 8, 2016 13:41
-
-
Save AlexDenisov/1e3ccbb59a53c5e05d9a to your computer and use it in GitHub Desktop.
This file contains hidden or 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