All of lore.kernel.org
 help / color / mirror / Atom feed
From: Han-Wen Nienhuys <hanwen@xs4all.nl>
To: git@vger.kernel.org
Subject: Re: git tag: don't complain of empty messages
Date: Sun, 26 Nov 2006 17:42:49 +0100	[thread overview]
Message-ID: <4569C409.5080509@xs4all.nl> (raw)
In-Reply-To: <7v64dgo9gj.fsf@assigned-by-dhcp.cox.net>

Junio C Hamano escreveu:
> Please follow Documentation/SubmittingPatches.

See below, hope I didn't mess up.



From be40730d19592f9db8f07f619f5723060c2f4f0c Mon Sep 17 00:00:00 2001
From: Han-Wen Nienhuys <hanwen@lilypond.org>
Date: Sun, 26 Nov 2006 17:41:30 +0100
Subject: [PATCH] allow empty tag message if -m is given explicitly.

---
 git-tag.sh |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/git-tag.sh b/git-tag.sh
index ac269e3..d53f94c 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -5,6 +5,7 @@ USAGE='-l [<pattern>] | [-a | -s | -u <k
 SUBDIRECTORY_OK='Yes'
 . git-sh-setup
 
+message_given=
 annotate=
 signed=
 force=
@@ -37,6 +38,12 @@ do
     	annotate=1
 	shift
 	message="$1"
+	if test "$#" = "0"; then
+	    die "error: option -m needs an argument"
+	    exit 2
+	else
+	    message_given=1
+	fi
 	;;
     -u)
 	annotate=1
@@ -83,7 +90,7 @@ tagger=$(git-var GIT_COMMITTER_IDENT) ||
 trap 'rm -f "$GIT_DIR"/TAG_TMP* "$GIT_DIR"/TAG_FINALMSG "$GIT_DIR"/TAG_EDITMSG' 0
 
 if [ "$annotate" ]; then
-    if [ -z "$message" ]; then
+    if [ -z "$message_given" ]; then
         ( echo "#"
           echo "# Write a tag message"
           echo "#" ) > "$GIT_DIR"/TAG_EDITMSG
@@ -95,7 +102,7 @@ if [ "$annotate" ]; then
     grep -v '^#' <"$GIT_DIR"/TAG_EDITMSG |
     git-stripspace >"$GIT_DIR"/TAG_FINALMSG
 
-    [ -s "$GIT_DIR"/TAG_FINALMSG ] || {
+    [ -s "$GIT_DIR"/TAG_FINALMSG -o -n "$message_given" ] || {
 	echo >&2 "No tag message?"
 	exit 1
     }
-- 
1.4.2.4


-- 
 Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen

  parent reply	other threads:[~2006-11-26 16:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-15 15:34 git tag: don't complain of empty messages Han-Wen Nienhuys
2006-11-15 16:02 ` Johannes Schindelin
2006-11-15 16:05   ` Han-Wen Nienhuys
2006-11-15 16:19     ` Johannes Schindelin
2006-11-15 18:23 ` Junio C Hamano
2006-11-16  0:14   ` Han-Wen Nienhuys
2006-11-16  0:38     ` Jakub Narebski
2006-11-16  1:27       ` Han-Wen Nienhuys
2006-11-26 16:42   ` Han-Wen Nienhuys [this message]
2006-11-26 16:46     ` Han-Wen Nienhuys

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4569C409.5080509@xs4all.nl \
    --to=hanwen@xs4all.nl \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.