From 076f08d65a7b88a70c958712205b47706ce6a0c3 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Mon, 8 Sep 2008 14:24:06 +0800 Subject: [PATCH] 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. --- ChangeLog | 9 +++++++++ HACKING | 4 ++-- clcommit.m4sh | 12 +++++++++++- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d62d219e7..78e656bcd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-09-07 Gary V. Vaughan + + 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 Retire gnu.org news.html in favour of savannah news. diff --git a/HACKING b/HACKING index 346ad15fa..c7efe410c 100644 --- a/HACKING +++ b/HACKING @@ -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. diff --git a/clcommit.m4sh b/clcommit.m4sh index 3394311a9..0d3ba42fc 100644 --- a/clcommit.m4sh +++ b/clcommit.m4sh @@ -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 : } -- 2.47.2