Commit 6fa8fed2 authored by Myke Hines's avatar Myke Hines

Release finish squash parameter

Adding an optional (false by default) -S option to 'git flow release finish' to allow squashing
the commit
parent ab7fda21
...@@ -45,7 +45,7 @@ PREFIX=$(git config --get gitflow.prefix.release) ...@@ -45,7 +45,7 @@ PREFIX=$(git config --get gitflow.prefix.release)
usage() { usage() {
echo "usage: git flow release [list] [-v]" echo "usage: git flow release [list] [-v]"
echo " git flow release start [-F] <version> [<base>]" echo " git flow release start [-F] <version> [<base>]"
echo " git flow release finish [-Fsumpk] <version>" echo " git flow release finish [-FsumpkS] <version>"
echo " git flow release publish <name>" echo " git flow release publish <name>"
echo " git flow release track <name>" echo " git flow release track <name>"
} }
...@@ -193,6 +193,7 @@ cmd_finish() { ...@@ -193,6 +193,7 @@ cmd_finish() {
DEFINE_boolean push false "push to $ORIGIN after performing finish" p DEFINE_boolean push false "push to $ORIGIN after performing finish" p
DEFINE_boolean keep false "keep branch after performing finish" k DEFINE_boolean keep false "keep branch after performing finish" k
DEFINE_boolean notag false "don't tag this release" n DEFINE_boolean notag false "don't tag this release" n
DEFINE_boolean squash false "squash release during merge" S
parse_args "$@" parse_args "$@"
require_version_arg require_version_arg
...@@ -224,9 +225,15 @@ cmd_finish() { ...@@ -224,9 +225,15 @@ cmd_finish() {
if ! git_is_branch_merged_into "$BRANCH" "$MASTER_BRANCH"; then if ! git_is_branch_merged_into "$BRANCH" "$MASTER_BRANCH"; then
git checkout "$MASTER_BRANCH" || \ git checkout "$MASTER_BRANCH" || \
die "Could not check out $MASTER_BRANCH." die "Could not check out $MASTER_BRANCH."
git merge --no-ff "$BRANCH" || \ if noflag squash; then
die "There were merge conflicts." git merge --no-ff "$BRANCH" || \
# TODO: What do we do now? die "There were merge conflicts."
# TODO: What do we do now?
else
git merge --squash "$BRANCH" || \
die "There were merge conflicts."
git commit
fi
fi fi
if noflag notag; then if noflag notag; then
...@@ -253,9 +260,16 @@ cmd_finish() { ...@@ -253,9 +260,16 @@ cmd_finish() {
# TODO: Actually, accounting for 'git describe' pays, so we should # TODO: Actually, accounting for 'git describe' pays, so we should
# ideally git merge --no-ff $tagname here, instead! # ideally git merge --no-ff $tagname here, instead!
git merge --no-ff "$BRANCH" || \ if noflag squash; then
die "There were merge conflicts." git merge --no-ff "$BRANCH" || \
# TODO: What do we do now? die "There were merge conflicts."
# TODO: What do we do now?
else
git merge --squash "$BRANCH" || \
die "There were merge conflicts."
# TODO: What do we do now?
git commit
fi
fi fi
# delete branch # delete branch
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment