Commit 75fbdd7b authored by Myke Hines's avatar Myke Hines

Feature finish squash parameter

Adding an optional (false by default) -S option to 'git flow feature finish' to allow squashing
the commit
parent 6fa8fed2
...@@ -44,7 +44,7 @@ PREFIX=$(git config --get gitflow.prefix.feature) ...@@ -44,7 +44,7 @@ PREFIX=$(git config --get gitflow.prefix.feature)
usage() { usage() {
echo "usage: git flow feature [list] [-v]" echo "usage: git flow feature [list] [-v]"
echo " git flow feature start [-F] <name> [<base>]" echo " git flow feature start [-F] <name> [<base>]"
echo " git flow feature finish [-rFkD] [<name|nameprefix>]" echo " git flow feature finish [-rFkDS] [<name|nameprefix>]"
echo " git flow feature publish <name>" echo " git flow feature publish <name>"
echo " git flow feature track <name>" echo " git flow feature track <name>"
echo " git flow feature diff [<name|nameprefix>]" echo " git flow feature diff [<name|nameprefix>]"
...@@ -232,6 +232,7 @@ cmd_finish() { ...@@ -232,6 +232,7 @@ cmd_finish() {
DEFINE_boolean rebase false "rebase instead of merge" r DEFINE_boolean rebase false "rebase instead of merge" r
DEFINE_boolean keep false "keep branch after performing finish" k DEFINE_boolean keep false "keep branch after performing finish" k
DEFINE_boolean force_delete false "force delete feature branch after finish" D DEFINE_boolean force_delete false "force delete feature branch after finish" D
DEFINE_boolean squash false "squash feature during merge" S
parse_args "$@" parse_args "$@"
expand_nameprefix_arg_or_current expand_nameprefix_arg_or_current
...@@ -312,7 +313,13 @@ cmd_finish() { ...@@ -312,7 +313,13 @@ cmd_finish() {
if [ "$(git rev-list -n2 "$DEVELOP_BRANCH..$BRANCH" | wc -l)" -eq 1 ]; then if [ "$(git rev-list -n2 "$DEVELOP_BRANCH..$BRANCH" | wc -l)" -eq 1 ]; then
git merge --ff "$BRANCH" git merge --ff "$BRANCH"
else else
git merge --no-ff "$BRANCH" if noflag squash; then
git merge --no-ff "$BRANCH"
else
git merge --squash "$BRANCH"
git commit
git merge "$BRANCH"
fi
fi fi
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
...@@ -353,7 +360,7 @@ helper_finish_cleanup() { ...@@ -353,7 +360,7 @@ helper_finish_cleanup() {
git branch -d "$BRANCH" git branch -d "$BRANCH"
fi fi
fi fi
t
echo echo
echo "Summary of actions:" echo "Summary of actions:"
echo "- The feature branch '$BRANCH' was merged into '$DEVELOP_BRANCH'" echo "- The feature branch '$BRANCH' was merged into '$DEVELOP_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