mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
added changelog to release as optional flag
- rewrote the flags to contain multiple - added -c as changelog option
This commit is contained in:
parent
d437418b3c
commit
292586d96f
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -7,10 +7,11 @@
|
|||
\fBgit\-release\fR \- Commit, tag and push changes to the repository
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
\fBgit\-release\fR <tagname> [<remote>]
|
||||
\fBgit\-release\fR <tagname> [-c] [-r <remote>]
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Commits changes with message "Release <tagname>", tags with the given <tagname> and pushes the branch / tags\.
|
||||
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\.
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
<tagname>
|
||||
|
|
@ -19,7 +20,13 @@ Commits changes with message "Release <tagname>", tags with the given <tagname>
|
|||
The name of the newly created tag\. Also used in tag comment\.
|
||||
.
|
||||
.P
|
||||
<remote>
|
||||
-c
|
||||
.
|
||||
.P
|
||||
Generates or populates the changelog with all commit message since the last tag. For more info see git-changelog.\.
|
||||
.
|
||||
.P
|
||||
-r <remote>
|
||||
.
|
||||
.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 <tagname>\.
|
|||
$ git release 0\.1\.0
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Release commit with the given <tagname> and populate changelog\.
|
||||
.
|
||||
.IP
|
||||
$ git release 0\.1\.0 -c
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
Release commit with the given <tagname> and push to specific remote\.
|
||||
.
|
||||
.IP
|
||||
$ git release 0\.1\.0 github
|
||||
$ git release 0\.1\.0 -r github
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
|
|
|
|||
|
|
@ -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 <<tj@vision-media.ca>>
|
||||
Extended by David Hartmann <<dh@tsl.io>>
|
||||
|
||||
## REPORTING BUGS
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue