diff --git a/bin/git-release b/bin/git-release index a5ff60b..78549af 100755 --- a/bin/git-release +++ b/bin/git-release @@ -9,12 +9,26 @@ hook() { } if test $# -gt 0; then + version=$1 + shift #remove version from arguments list + remote='' hook pre-release - echo "... releasing $1" - git commit -a -m "Release $1" - git tag $1 -a -m "Release $1" \ - && git push $2 \ - && git push $2 --tags \ + echo "... releasing $version" + # check for flags + while test $# != 0 + do + case "$1" in + -c) git-changelog -t "$version" ;; + -r) remote=$2; shift ;; + --) shift; break;; + *) usage ;; + esac + shift + done + git commit -a -m "Release $version" + git tag $version -a -m "Release $version" \ + && git push $remote \ + && git push $remote --tags \ && hook post-release \ && echo "... complete" else diff --git a/man/git-release.1 b/man/git-release.1 index 796d555..77162cb 100644 --- a/man/git-release.1 +++ b/man/git-release.1 @@ -7,10 +7,11 @@ \fBgit\-release\fR \- Commit, tag and push changes to the repository . .SH "SYNOPSIS" -\fBgit\-release\fR [] +\fBgit\-release\fR [-c] [-r ] . .SH "DESCRIPTION" -Commits changes with message "Release ", tags with the given and pushes the branch / tags\. +Commits changes with message "Release ", tags with the given 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\. . .SH "OPTIONS" @@ -19,7 +20,13 @@ Commits changes with message "Release ", tags with the given The name of the newly created tag\. Also used in tag comment\. . .P - +-c +. +.P +Generates or populates the changelog with all commit message since the last tag. For more info see git-changelog.\. +. +.P +-r . .P The "remote" repository that is destination of a push operation: it is passed to git push\. @@ -33,10 +40,16 @@ Release commit with the given \. $ git release 0\.1\.0 . .IP "\(bu" 4 +Release commit with the given and populate changelog\. +. +.IP +$ git release 0\.1\.0 -c +. +.IP "\(bu" 4 Release commit with the given and push to specific remote\. . .IP -$ git release 0\.1\.0 github +$ git release 0\.1\.0 -r github . .IP "" 0 . diff --git a/man/git-release.md b/man/git-release.md index 7ae43c6..44c2938 100644 --- a/man/git-release.md +++ b/man/git-release.md @@ -3,11 +3,12 @@ git-release(1) -- Commit, tag and push changes to the repository ## SYNOPSIS -`git-release` <tagname> [<remote>] +`git-release` <tagname> [-r <remote>] [-c] ## DESCRIPTION Commits changes with message "Release <tagname>", 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 @@ -15,9 +16,13 @@ git-release(1) -- Commit, tag and push changes to the repository The name of the newly created tag. Also used in tag comment. - <remote> + -r <remote> The "remote" repository that is destination of a push operation: it is passed to git push. + + -c + + Generates or populates the changelog with all commit message since the last tag. For more info see git-changelog.. ## EXAMPLES @@ -27,11 +32,20 @@ git-release(1) -- Commit, tag and push changes to the repository * Release commit with the given <tagname> and push to specific remote. - $ git release 0.1.0 github + $ git release 0.1.0 -r github + + * Release commit with the given <tagname> and populate changelog. + + $ git release 0.1.0 -c + + * Release commit with the given <tagname>, populate changelog, and push to specific remote. + + $ git release 0.1.0 -r github -c ## AUTHOR Written by Tj Holowaychuk <> +Extended by David Hartmann <> ## REPORTING BUGS