git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-tag: Fix the main while loop exit condition.

From
Sam Vilain <sam@vilain.net>
Date
Jun 30, 2007, 06:04 UTC
Message-ID
<4685F275.8030508@vilain.net>
In-Reply-To
<7vy7i3mxw3.fsf@assigned-by-dhcp.pobox.com>
Junio C Hamano wrote:
Show 10 quoted lines
> 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
Previous: Junio C Hamano
Message 3 of 3 in “git-tag: Fix the main while loop exit condition.”
  1. git-tag: Fix the main while loop exit condition.Alexandre Vassalotti, Jun 28, 2007
  2. Junio C HamanoJun 29, 2007
  3. Sam VilainJun 30, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.