mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
git-release: add --no-empty-commit for empty commit hater
This commit is contained in:
parent
8714ac4aa1
commit
de364cfac1
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -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 [<tagname> | \-\-semver <name>] [\-r <remote>] [\-m <commit info>] [\-c] [[\-\-] <hook arguments\.\.\.>]
|
||||
\fBgit\-release\fR [<tagname> | \-\-semver <name>] [\-r <remote>] [\-m <commit info>] [\-\-no\-empty\-commit] [\-c] [[\-\-] <hook arguments\.\.\.>]
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Commits changes with message "Release <tagname>" or custom commit information, tags with the given <tagname> and pushes the branch / tags\.
|
||||
.
|
||||
.P
|
||||
This command always creates a release commit, which could be empty if nothing changed\. It works like \fBgit merge \-\-no\-ff\fR\. If you don\'t like the behavior, you could add \fB\-\-no\-empty\-commit\fR to skip it\.
|
||||
.
|
||||
.P
|
||||
Optionally it generates a changelog (see git\-changelog) and a remote can be defined\. The order of first \-c or \-r does not matter\.
|
||||
.
|
||||
.P
|
||||
|
|
@ -43,6 +46,12 @@ The "remote" repository that is destination of a push operation: it is passed to
|
|||
use the custom commit information instead of the default message "Release <tagname>" \.
|
||||
.
|
||||
.P
|
||||
\-\-no\-empty\-commit
|
||||
.
|
||||
.P
|
||||
Avoid creating empty commit if nothing could be committed\.
|
||||
.
|
||||
.P
|
||||
\-c
|
||||
.
|
||||
.P
|
||||
|
|
|
|||
|
|
@ -76,12 +76,14 @@
|
|||
|
||||
<h2 id="SYNOPSIS">SYNOPSIS</h2>
|
||||
|
||||
<p><code>git-release</code> [<tagname> | --semver <name>] [-r <remote>] [-m <commit info>] [-c] [[--] <hook arguments...>]</p>
|
||||
<p><code>git-release</code> [<tagname> | --semver <name>] [-r <remote>] [-m <commit info>] [--no-empty-commit] [-c] [[--] <hook arguments...>]</p>
|
||||
|
||||
<h2 id="DESCRIPTION">DESCRIPTION</h2>
|
||||
|
||||
<p> Commits changes with message "Release <tagname>" or custom commit information, tags with the given <tagname> and pushes the branch / tags.</p>
|
||||
|
||||
<p> This command always creates a release commit, which could be empty if nothing changed. It works like <code>git merge --no-ff</code>. If you don't like the behavior, you could add <code>--no-empty-commit</code> to skip it.</p>
|
||||
|
||||
<p> Optionally it generates a changelog (see git-changelog) and a remote can be defined. The order of first -c or -r does not matter.</p>
|
||||
|
||||
<p> If <code>.git/hook/pre-release</code> or <code>.git/hook/post-release</code> exist, they will be triggered with <code>tagname</code> and extra hook arguments before/after the release.</p>
|
||||
|
|
@ -106,6 +108,10 @@
|
|||
|
||||
<p> use the custom commit information instead of the default message "Release <tagname>" .</p>
|
||||
|
||||
<p> --no-empty-commit</p>
|
||||
|
||||
<p> Avoid creating empty commit if nothing could be committed.</p>
|
||||
|
||||
<p> -c</p>
|
||||
|
||||
<p> Generates or populates the changelog with all commit message since the last tag. For more info see git-changelog..</p>
|
||||
|
|
@ -141,8 +147,8 @@ populate changelog, and push to specific remote.</p>
|
|||
|
||||
<h2 id="AUTHOR">AUTHOR</h2>
|
||||
|
||||
<p>Written by Tj Holowaychuk <<a href="mailto:tj@vision-media.ca" data-bare-link="true">tj@vision-media.ca</a>>
|
||||
Extended by David Hartmann <<a href="mailto:dh@tsl.io" data-bare-link="true">dh@tsl.io</a>></p>
|
||||
<p>Written by Tj Holowaychuk <<a href="mailto:tj@vision-media.ca" data-bare-link="true">tj@vision-media.ca</a>>
|
||||
Extended by David Hartmann <<a href="mailto:dh@tsl.io" data-bare-link="true">dh@tsl.io</a>></p>
|
||||
|
||||
<h2 id="REPORTING-BUGS">REPORTING BUGS</h2>
|
||||
|
||||
|
|
@ -155,7 +161,7 @@ Extended by David Hartmann <<a href="mailto:
|
|||
|
||||
<ol class='man-decor man-foot man foot'>
|
||||
<li class='tl'></li>
|
||||
<li class='tc'>December 2017</li>
|
||||
<li class='tc'>February 2018</li>
|
||||
<li class='tr'>git-release(1)</li>
|
||||
</ol>
|
||||
|
||||
|
|
|
|||
|
|
@ -3,12 +3,14 @@ git-release(1) -- Commit, tag and push changes to the repository
|
|||
|
||||
## 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
|
||||
|
||||
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 `git merge --no-ff`. If you don't like the behavior, you could add `--no-empty-commit` to skip it.
|
||||
|
||||
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 `.git/hook/pre-release` or `.git/hook/post-release` exist, they will be triggered with `tagname` and extra hook arguments before/after the release.
|
||||
|
|
@ -33,6 +35,10 @@ git-release(1) -- Commit, tag and push changes to the repository
|
|||
|
||||
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..
|
||||
|
|
|
|||
Loading…
Reference in a new issue