Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wright <chrisw@osdl.org>2005-08-09 04:04:42 +0400
committerJunio C Hamano <junkio@cox.net>2005-08-09 09:51:46 +0400
commitc882bc932f6702a935c748893536356b0bba11ce (patch)
tree9522cc3e6c2f75d956538e290b7660a2eead4c64 /git-tag-script
parentadee7bdf504120055b0f36b4918bdd3e6156912b (diff)
[PATCH] Add -m <message> option to "git tag"
Allow users to create a tag message by passing message on command line instead of requiring an $EDITOR session. Signed-off-by: Chris Wright <chrisw@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-tag-script')
-rwxr-xr-xgit-tag-script20
1 files changed, 15 insertions, 5 deletions
diff --git a/git-tag-script b/git-tag-script
index 4917f99576..d3074a8b3d 100755
--- a/git-tag-script
+++ b/git-tag-script
@@ -4,13 +4,14 @@
. git-sh-setup-script || die "Not a git archive"
usage () {
- echo >&2 "Usage: git-tag-script [-a | -s] [-f] tagname"
+ echo >&2 "Usage: git-tag-script [-a | -s] [-f] [-m "tag message"] tagname"
exit 1
}
annotate=
signed=
force=
+message=
while case "$#" in 0) break ;; esac
do
case "$1" in
@@ -24,6 +25,11 @@ do
-f)
force=1
;;
+ -m)
+ annotate=1
+ shift
+ message="$1"
+ ;;
-*)
usage
;;
@@ -48,10 +54,14 @@ tagger=$(git-var GIT_COMMITTER_IDENT) || exit 1
trap 'rm -f .tmp-tag* .tagmsg .editmsg' 0
if [ "$annotate" ]; then
- ( echo "#"
- echo "# Write a tag message"
- echo "#" ) > .editmsg
- ${VISUAL:-${EDITOR:-vi}} .editmsg || exit
+ if [ -z "$message" ]; then
+ ( echo "#"
+ echo "# Write a tag message"
+ echo "#" ) > .editmsg
+ ${VISUAL:-${EDITOR:-vi}} .editmsg || exit
+ else
+ echo "$message" > .editmsg
+ fi
grep -v '^#' < .editmsg | git-stripspace > .tagmsg