git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Vilain <sam@vilain.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Alexandre Vassalotti <alexandre@peadrop.com>, git@vger.kernel.org
Subject: Re: [PATCH] git-tag: Fix the main while loop exit condition.
Date: Sat, 30 Jun 2007 18:04:37 +1200	[thread overview]
Message-ID: <4685F275.8030508@vilain.net> (raw)
In-Reply-To: <7vy7i3mxw3.fsf@assigned-by-dhcp.pobox.com>

Junio C Hamano wrote:
> Thanks.
> 
> I think you would need something like this on top if you want to
> really fix it, though.
> 
> I also suspect that we should error out on:
> 
> 	$ git tag -l foo bar
> 
> but that will be left as an exercise to the readers ;-)

More is required...

diff --git a/git-tag.sh b/git-tag.sh
index 48b54a1..480d16d 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -82,7 +82,9 @@ do
 	if test "$#" = "0"; then
 	    die "error: option -m needs an argument"
 	else
+	    message="$1"
 	    message_given=1
+	    shift
 	fi
 	;;
     -F)
@@ -93,13 +95,19 @@ do
 	else
 	    message="$(cat "$1")"
 	    message_given=1
+	    shift
 	fi
 	;;
     -u)
 	annotate=1
 	signed=1
 	shift
-	username="$1"
+	if test "$#" = "0"; then
+	    die "error: option -u needs an argument"
+	else
+	    username="$1"
+	    shift
+	fi
 	;;
     -d)
 	shift

      reply	other threads:[~2007-06-30  6:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-28 16:56 [PATCH] git-tag: Fix the main while loop exit condition Alexandre Vassalotti
2007-06-29  0:01 ` Junio C Hamano
2007-06-30  6:04   ` Sam Vilain [this message]

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=4685F275.8030508@vilain.net \
    --to=sam@vilain.net \
    --cc=alexandre@peadrop.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).