22 lines
513 B
Text
22 lines
513 B
Text
|
#!/bin/zsh
|
||
|
branch=$1
|
||
|
branchParts=( ${(s:/:)branch} )
|
||
|
kind=$branchParts[1]
|
||
|
name=$branchParts[2]
|
||
|
echo "Finishing $kind '$name'..." >&2
|
||
|
|
||
|
git checkout $branch || exit $?
|
||
|
|
||
|
merge-into() {
|
||
|
echo "Merging $branch into $1..." >&2
|
||
|
git checkout $1 || exit $?
|
||
|
git merge --no-ff $branch --message "Merge $kind '$name' into $1" || exit $?
|
||
|
}
|
||
|
|
||
|
[[ $kind = hotfix ]] && merge-into master
|
||
|
merge-into develop
|
||
|
|
||
|
echo "Merge successful, deleting $branch..." >&2
|
||
|
git push origin --delete $branch || exit $?
|
||
|
git branch --delete $branch
|