Add optional pull request support to git-finish (it just adds the request ID to the commit messages)

This commit is contained in:
Danielle McLean 2018-03-15 11:37:06 +11:00
parent a1949c40a2
commit ea343dbfa0
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5

View file

@ -3,14 +3,18 @@ branch=$1
branchParts=( ${(s:/:)branch} ) branchParts=( ${(s:/:)branch} )
kind=$branchParts[1] kind=$branchParts[1]
name=$branchParts[2] name=$branchParts[2]
echo "Finishing $kind '$name'..." >&2
pullreq=$2
[[ -n pullreq ]] && pullreq=" (pull request #$pullreq)"
echo "Finishing $kind '$name'$pullreq..." >&2
git checkout $branch || exit $? git checkout $branch || exit $?
merge-into() { merge-into() {
echo "Merging $branch into $1..." >&2 echo "Merging $branch into $1..." >&2
git checkout $1 || exit $? git checkout $1 || exit $?
git merge --no-ff $branch --message "Merge $kind '$name' into $1" || exit $? git merge --no-ff $branch --message "Merge $kind '$name'$pullreq into $1" || exit $?
} }
[[ $kind = hotfix ]] && merge-into master [[ $kind = hotfix ]] && merge-into master