diff --git a/git-flow-feature b/git-flow-feature index e97d67825..c85c1e37f 100644 --- a/git-flow-feature +++ b/git-flow-feature @@ -44,7 +44,7 @@ PREFIX=$(git config --get gitflow.prefix.feature) usage() { echo "usage: git flow feature [list] [-v]" echo " git flow feature start [-F] []" - echo " git flow feature finish [-rFkD] []" + echo " git flow feature finish [-rFkDS] []" echo " git flow feature publish " echo " git flow feature track " echo " git flow feature diff []" @@ -232,6 +232,7 @@ cmd_finish() { DEFINE_boolean rebase false "rebase instead of merge" r DEFINE_boolean keep false "keep branch after performing finish" k DEFINE_boolean force_delete false "force delete feature branch after finish" D + DEFINE_boolean squash false "squash feature during merge" S parse_args "$@" expand_nameprefix_arg_or_current @@ -312,7 +313,13 @@ cmd_finish() { if [ "$(git rev-list -n2 "$DEVELOP_BRANCH..$BRANCH" | wc -l)" -eq 1 ]; then git merge --ff "$BRANCH" 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 if [ $? -ne 0 ]; then @@ -353,7 +360,7 @@ helper_finish_cleanup() { git branch -d "$BRANCH" fi fi - +t echo echo "Summary of actions:" echo "- The feature branch '$BRANCH' was merged into '$DEVELOP_BRANCH'"