Skip to content

Commit 8124333

Browse files
authored
fix: multi-line tag message when using -m
* fix: multi-line tag message when using -m Gitflow release finish and hotfix finish allow for a tag message to be entered from the command line. Currently only the last messeage is read by git flow if multiple messages are passed in on the command line. The git binary does not allow for the use of the \n escape sequence when entering a message from the command line via -m. As a result multiple invocations of the option must be used for a multi-line commit message. As a workaround when using the git binary directly we can use printf inside of the commit message to properly handle \n escape codes. This allows for a single invocation of -m. To use this workaround inside of the double quotes we use $(printf 'line of text with \n escape codes placed as needed for proper formating of the message') This commit will add the above workaround when entering a tag message from the command line for release finish and hotfix finish. * docs: add snapshot release to changelog * chore: bump version to snapshot release
1 parent eca1cb9 commit 8124333

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
#### 2.1.0-SNAPSHOT
4+
* fix: multi-line tag message when using -m
5+
6+
**NOTE:** The format for a multi-line tag message is now "$(printf 'line of text with \n escape codes placed as needed for proper formating of the message')"
7+
8+
39
#### 2.0.1
410
* fix incorrect version identification along with updating source repository in gitflow-installer. Corrections pointed out by [bobstuart](https://github.com/bobstuart)
511

git-flow-hotfix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ T,tagname! Use given tag name
547547
opts="$opts -m '$FLAGS_message'"
548548
fi
549549
[ "$FLAGS_messagefile" != "" ] && opts="$opts -F '$FLAGS_messagefile'"
550-
eval git_do tag $opts "$VERSION_PREFIX$TAGNAME" || die "Tagging failed. Please run finish again to retry."
550+
eval git_do tag "$opts" "$VERSION_PREFIX$TAGNAME" || die "Tagging failed. Please run finish again to retry."
551551
fi
552552
fi
553553

git-flow-release

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ _finish_from_develop() {
140140
opts="$opts -m $VERSION_PREFIX$TAGNAME"
141141
fi
142142
fi
143-
eval git_do tag $opts "$VERSION_PREFIX$TAGNAME" || die "Tagging failed. Please run finish again to retry."
143+
eval git_do tag "$opts" "$VERSION_PREFIX$TAGNAME" || die "Tagging failed. Please run finish again to retry."
144144
fi
145145
fi
146146

@@ -342,7 +342,7 @@ _finish_base() {
342342
opts="$opts -m $VERSION_PREFIX$TAGNAME"
343343
fi
344344
fi
345-
eval git_do tag $opts "$VERSION_PREFIX$TAGNAME" || die "Tagging failed. Please run finish again to retry."
345+
eval git_do tag "$opts" "$VERSION_PREFIX$TAGNAME" || die "Tagging failed. Please run finish again to retry."
346346
fi
347347
fi
348348

@@ -889,7 +889,7 @@ S,[no]squash Squash release during merge
889889
opts="$opts -m '$FLAGS_message'"
890890
fi
891891
[ "$FLAGS_messagefile" != "" ] && opts="$opts -F '$FLAGS_messagefile'"
892-
eval git_do tag $opts "$VERSION_PREFIX$VERSION" || die "Tagging failed. Please run finish again to retry."
892+
eval git_do tag "$opts" "$VERSION_PREFIX$VERSION" || die "Tagging failed. Please run finish again to retry."
893893
fi
894894
fi
895895

git-flow-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#
3939

4040

41-
GITFLOW_VERSION=2.0.1
41+
GITFLOW_VERSION=2.1.0-SNAPSHOT
4242

4343
initialize() {
4444
# A function can not be empty. Comments count as empty.

0 commit comments

Comments
 (0)