Feature finish squash parameter
Adding an optional (false by default) -S option to 'git flow feature finish' to allow squashing
the commit
diff --git a/git-flow-feature b/git-flow-feature
index e97d678..c85c1e3 100644
--- a/git-flow-feature
+++ b/git-flow-feature
@@ -44,7 +44,7 @@
usage() {
echo "usage: git flow feature [list] [-v]"
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 track <name>"
echo " git flow feature diff [<name|nameprefix>]"
@@ -232,6 +232,7 @@
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 @@
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 @@
git branch -d "$BRANCH"
fi
fi
-
+t
echo
echo "Summary of actions:"
echo "- The feature branch '$BRANCH' was merged into '$DEVELOP_BRANCH'"