summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: adee7bd)
raw | patch | inline | side by side (parent: adee7bd)
author | Chris Wright <chrisw@osdl.org> | |
Tue, 9 Aug 2005 00:04:42 +0000 (17:04 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 9 Aug 2005 05:51:46 +0000 (22:51 -0700) |
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>
instead of requiring an $EDITOR session.
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-tag-script | patch | blob | history |
diff --git a/git-tag-script b/git-tag-script
index 4917f99576ef91266a63a12899f16de6589ea226..d3074a8b3d84d878f568f8b04867e923e1628fe5 100755 (executable)
--- a/git-tag-script
+++ b/git-tag-script
. 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
-f)
force=1
;;
+ -m)
+ annotate=1
+ shift
+ message="$1"
+ ;;
-*)
usage
;;
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