From 48eb195ee0426fe398e3082fed90500d370e5a5c Mon Sep 17 00:00:00 2001 From: Riceball LEE Date: Thu, 12 Feb 2015 17:55:31 +0800 Subject: [PATCH] + custom commit message options supports --- bin/git-release | 8 ++++++-- man/git-release.md | 12 ++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bin/git-release b/bin/git-release index a40e348..e6869f9 100755 --- a/bin/git-release +++ b/bin/git-release @@ -29,13 +29,17 @@ if test $# -gt 0; then case "$1" in -c) git-changelog -t "$version" ;; -r) remote=$2; shift ;; + -m) msg=$2; shift ;; --) shift; break;; *) usage ;; esac shift done - git commit -a -m "Release $version" - git tag $version -a -m "Release $version" \ + if [ -z "$msg" ]; then + msg="Release ${version}" + fi + git commit -a -m "$msg" + git tag $version -a -m "$msg" \ && git push $remote \ && git push $remote --tags \ && hook post-release \ diff --git a/man/git-release.md b/man/git-release.md index 61018d0..5dd21ab 100644 --- a/man/git-release.md +++ b/man/git-release.md @@ -3,11 +3,11 @@ git-release(1) -- Commit, tag and push changes to the repository ## SYNOPSIS -`git-release` <tagname> [-r <remote>] [-c] +`git-release` <tagname> [-r <remote>] [-m <commit info%gt;] [-c] ## DESCRIPTION - Commits changes with message "Release <tagname>", tags with the given <tagname> and pushes the branch / tags. + Commits changes with message "Release <tagname>" or custom commit infomation, tags with the given <tagname> and pushes the branch / tags. Optionally it generates a changelog (see git-changelog) and a remote can be defined. The order of first -c or -r does not matter. ## OPTIONS @@ -20,6 +20,10 @@ git-release(1) -- Commit, tag and push changes to the repository The "remote" repository that is destination of a push operation: it is passed to git push. + -m <commit info> + + use the custom commit infomation instead of the default message "Release <tagname>" . + -c Generates or populates the changelog with all commit message since the last tag. For more info see git-changelog.. @@ -30,6 +34,10 @@ git-release(1) -- Commit, tag and push changes to the repository $ git release 0.1.0 + * Release commit with the given <tagname> and custom commit message. + + $ git release 0.1.0 -m "+ powerful feature added." + * Release commit with the given <tagname> and push to specific remote. $ git release 0.1.0 -r github