Add ./commit option for pushing tags back to origin.

* clcommit.m4sh (opt_tags): New --tags push option.
(func_commit): Run `$GIT push --tags' if --tags was passed.
* HACKING (Release Procedure): Note the requirement to pass
--tags to ./commit for new release tag to be push back to
origin.
This commit is contained in:
Gary V. Vaughan 2008-09-08 14:24:06 +08:00
parent 5eaa40f7f6
commit 076f08d65a
3 changed files with 22 additions and 3 deletions

View File

@ -1,3 +1,12 @@
2008-09-07 Gary V. Vaughan <gary@gnu.org>
Add ./commit option for pushing tags back to origin.
* clcommit.m4sh (opt_tags): New --tags push option.
(func_commit): Run `$GIT push --tags' if --tags was passed.
* HACKING (Release Procedure): Note the requirement to pass
--tags to ./commit for new release tag to be push back to
origin.
2008-09-07 Gary V. Vaughan <gary@gnu.org>
Retire gnu.org news.html in favour of savannah news.

View File

@ -699,7 +699,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
and `make distcheck CC=g++'
If there are any problems, fix them and start again.
* Run ./commit from the source tree.
* Run `./commit -p' from the source tree.
* Run `make -fMakefile.maint git-dist' (or `make -f../Makefile.maint
git-dist' if you are running from a VPATH build directory, where `../'
@ -725,7 +725,7 @@ or obtained by writing to the Free Software Foundation, Inc.,
* Update NEWS, ChangeLog.
* Run ./commit.
* Run `./commit -p --tags', to push the new changes and tags to origin.
* Update the webpages, libtool.html will need to indicate the latest
release number.

View File

@ -46,6 +46,7 @@ m4_divert_push([SCRIPT])#!/bin/sh
# --signature[=FILE] add FILE to the end of the email [~/.signature]
# --signoff add a Signed-off-by attribution at the end
# -S TEXT --summary=TEXT specify a TEXT subject line for the commit email
# --tags in conjunction with -p, also push tags
# -v --verbose run in verbose mode
# --version print version information
# -h,-? --help print short or long help message
@ -89,6 +90,7 @@ M4SH_VERBATIM([[
opt_commit=:
opt_first=false
opt_push=false
opt_tags=false
opt_update=:
opt_verbose=false
@ -237,6 +239,8 @@ set -e
shift
;;
--tags) opt_tags=: ;;
--verbose|-v) opt_verbose=: ;;
# Separate optargs to long options:
@ -283,6 +287,9 @@ set -e
func_error "can't use --signature without --sendmail." && exit_cmd=exit
fi
$opt_tags && test x"$opt_push" = xfalse &&
func_error "can't use --tags without --push." && exit_cmd=exit
# Bail if the options were screwed
$exit_cmd $EXIT_FAILURE
}
@ -366,7 +373,10 @@ func_commit ()
func_verbose "$GIT commit$git_flags -F $log_file ${1+$@}"
$GIT commit$git_flags -F $log_file ${1+"$@"} || exit $EXIT_FAILURE
$opt_push && $GIT push
if $opt_push; then
$GIT push
$opt_tags && $GIT push --tags
fi
:
}