@@ -104,12 +104,15 @@ _finish_from_develop() {
104104 # but the merge into master was successful, we skip it now
105105 if ! git_is_branch_merged_into " $BRANCH " " $MASTER_BRANCH " ; then
106106 git_do checkout " $MASTER_BRANCH " || die " Could not check out branch '$MASTER_BRANCH '."
107+
108+ opts=" "
109+ noflag edit && opts=" $opts --no-edit"
107110 if noflag squash; then
108- git_do merge --no-ff " $BRANCH " || die " There were merge conflicts." # TODO: What do we do now?
111+ git_do merge --no-ff $opts " $BRANCH " || die " There were merge conflicts." # TODO: What do we do now?
109112 else
110- git_do merge --squash " $BRANCH " || die " There were merge conflicts." # TODO: What do we do now?
113+ git_do merge --squash $opts " $BRANCH " || die " There were merge conflicts." # TODO: What do we do now?
111114 flag squash_info && gitflow_create_squash_message " Merged release branch '$BRANCH '" " $MASTER_BRANCH " " $BRANCH " > " $DOT_GIT_DIR /SQUASH_MSG"
112- git_do commit
115+ git_do commit $opts
113116 fi
114117 fi
115118
@@ -131,6 +134,12 @@ _finish_from_develop() {
131134 opts=" $opts -m '$FLAGS_message '"
132135 fi
133136 [ " $FLAGS_messagefile " != " " ] && opts=" $opts -F '$FLAGS_messagefile '"
137+ if noflag edit; then
138+ if [ " $FLAGS_message " = " " ] && [ " $FLAGS_messagefile " = " " ]; then
139+ # in order to fix annotated tag without message
140+ opts=" $opts -m $VERSION_PREFIX$TAGNAME "
141+ fi
142+ fi
134143 eval git_do tag $opts " $VERSION_PREFIX$TAGNAME " || die " Tagging failed. Please run finish again to retry."
135144 fi
136145 fi
@@ -150,6 +159,8 @@ _finish_from_develop() {
150159 if ! git_is_branch_merged_into " $merge_branch " " $DEVELOP_BRANCH " ; then
151160 git_do checkout " $DEVELOP_BRANCH " || die " Could not check out branch '$DEVELOP_BRANCH '."
152161
162+ opts=" "
163+ noflag edit && opts=" $opts --no-edit"
153164 if noflag nobackmerge; then
154165 # Accounting for 'git describe', if a release is tagged
155166 # we use the tag commit instead of the branch.
@@ -158,15 +169,15 @@ _finish_from_develop() {
158169 else
159170 commit=" $MASTER_BRANCH "
160171 fi
161- git_do merge --no-ff " $commit " || die " There were merge conflicts." # TODO: What do we do now?
172+ git_do merge --no-ff $opts " $commit " || die " There were merge conflicts." # TODO: What do we do now?
162173 else
163174 commit=" $BRANCH "
164175 if noflag squash; then
165- git_do merge --no-ff " $commit " || die " There were merge conflicts." # TODO: What do we do now?
176+ git_do merge --no-ff $opts " $commit " || die " There were merge conflicts." # TODO: What do we do now?
166177 else
167- git_do merge --squash " $commit " || die " There were merge conflicts." # TODO: What do we do now?
178+ git_do merge --squash $opts " $commit " || die " There were merge conflicts." # TODO: What do we do now?
168179 flag squash_info && gitflow_create_squash_message " Merged release branch '$BRANCH '" " $DEVELOP_BRANCH " " $BRANCH " > " $DOT_GIT_DIR /SQUASH_MSG"
169- git_do commit
180+ git_do commit $opts
170181 fi
171182 fi
172183 fi
@@ -325,6 +336,12 @@ _finish_base() {
325336 opts=" $opts -m '$FLAGS_message '"
326337 fi
327338 [ " $FLAGS_messagefile " != " " ] && opts=" $opts -F '$FLAGS_messagefile '"
339+ if noflag edit; then
340+ if [ " $FLAGS_message " = " " ] && [ " $FLAGS_messagefile " = " " ]; then
341+ # in order to fix annotated tag without message
342+ opts=" $opts -m $VERSION_PREFIX$TAGNAME "
343+ fi
344+ fi
328345 eval git_do tag $opts " $VERSION_PREFIX$TAGNAME " || die " Tagging failed. Please run finish again to retry."
329346 fi
330347 fi
@@ -603,7 +620,7 @@ v,verbose! Verbose (more) output
603620
604621cmd_finish () {
605622 OPTIONS_SPEC=" \
606- git flow release finish [-h] [-F] [-s] [-u] [-m | -f] [-p] [-k] [-n] [-b] [-S] <version>
623+ git flow release finish [-h] [-F] [-s] [-u] [-m | -f] [-p] [-k] [-n] [-b] [-S] [-e] <version>
607624
608625
609626Finish a release branch
@@ -627,6 +644,7 @@ n,[no]tag Don't tag this release
627644b,[no]nobackmerge Don't back-merge master, or tag if applicable, in develop
628645S,[no]squash Squash release during merge
629646[no]ff-master Fast forward master branch if possible
647+ e,[no]edit The --noedit option can be used to accept the auto-generated message on merging
630648T,tagname! Use given tag name
631649nodevelopmerge! Don't back-merge develop branch
632650"
@@ -649,6 +667,7 @@ nodevelopmerge! Don't back-merge develop branch
649667 DEFINE_boolean ' squash' false " squash release during merge" S
650668 DEFINE_boolean ' squash-info' false " add branch info during squash"
651669 DEFINE_boolean ' ff-master' false " fast forward master branch if possible"
670+ DEFINE_boolean ' edit' true " accept the auto-generated message on merging" e
652671 DEFINE_string ' tagname' " " " use the given tag name" T
653672 DEFINE_boolean ' nodevelopmerge' false " don't merge $BRANCH into $DEVELOP_BRANCH "
654673
0 commit comments