diff --git a/bin/git-release b/bin/git-release
index 1af5bf5..48f629f 100755
--- a/bin/git-release
+++ b/bin/git-release
@@ -35,6 +35,7 @@ if test $# -gt 0; then
-r) remote=$2; shift ;;
-m) msg=$2; shift ;;
--semver) semver=$2; shift ;;
+ --no-empty-commit) no_empty_commit=true;;
--) shift; hook_args="$hook_args $*"; break;;
*) test -z "$version" && version=$1 ;;
esac
@@ -88,7 +89,13 @@ if test $# -gt 0; then
if [ "$need_changelog" = true ]; then
git-changelog -t "$version"
fi
- git commit -a -m "$msg" --allow-empty
+
+ if [ "$no_empty_commit" = true ]; then
+ git commit -a -m "$msg" || true
+ else
+ git commit -a -m "$msg" --allow-empty
+ fi
+
# shellcheck disable=SC2086
git tag $version -a -m "$msg" \
&& git push $remote --tags \
diff --git a/man/git-release.1 b/man/git-release.1
index 44a1fc6..5b03b4d 100644
--- a/man/git-release.1
+++ b/man/git-release.1
@@ -1,18 +1,21 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
-.TH "GIT\-RELEASE" "1" "December 2017" "" ""
+.TH "GIT\-RELEASE" "1" "February 2018" "" ""
.
.SH "NAME"
\fBgit\-release\fR \- Commit, tag and push changes to the repository
.
.SH "SYNOPSIS"
-\fBgit\-release\fR [ Commits changes with message "Release <tagname>" or custom commit information, tags with the given <tagname> and pushes the branch / tags. This command always creates a release commit, which could be empty if nothing changed. It works like Optionally it generates a changelog (see git-changelog) and a remote can be defined. The order of first -c or -r does not matter. If use the custom commit information instead of the default message "Release <tagname>" . --no-empty-commit Avoid creating empty commit if nothing could be committed. -c Generates or populates the changelog with all commit message since the last tag. For more info see git-changelog..SYNOPSIS
-git-release [<tagname> | --semver <name>] [-r <remote>] [-m <commit info>] [-c] [[--] <hook arguments...>]git-release [<tagname> | --semver <name>] [-r <remote>] [-m <commit info>] [--no-empty-commit] [-c] [[--] <hook arguments...>]DESCRIPTION
git merge --no-ff. If you don't like the behavior, you could add --no-empty-commit to skip it..git/hook/pre-release or .git/hook/post-release exist, they will be triggered with tagname and extra hook arguments before/after the release.
Written by Tj Holowaychuk <tj@vision-media.ca> -Extended by David Hartmann <dh@tsl.io>
+Written by Tj Holowaychuk <tj@vision-media.ca> +Extended by David Hartmann <dh@tsl.io>