Permalink
Browse files

Feature finish squash parameter

Adding an optional (false by default) -S option to 'git flow feature finish' to allow squashing
the commit
  • Loading branch information...
1 parent 6fa8fed commit 75fbdd7bf7b81eb8965f5ec4e78fc8776373aa75 @mykehsd mykehsd committed Apr 19, 2012
Showing with 10 additions and 3 deletions.
  1. +10 −3 git-flow-feature
View
@@ -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] <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 @@ 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'"

0 comments on commit 75fbdd7

Please sign in to comment.