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

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

From
AVAlexandre Vassalotti <alexandre@peadrop.com>
Date
Jun 28, 2007, 16:56 UTC
Message-ID
<11830498172717-git-send-email-alexandre@peadrop.com>

This stop git-tag from emitting a "shift: can't shift that many" error, when listing tags.

Signed-off-by: Alexandre Vassalotti <alexandre@peadrop.com>
---
 git-tag.sh |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/git-tag.sh b/git-tag.sh
index c840439..bc0d735 100755
--- a/git-tag.sh
+++ b/git-tag.sh
@@ -14,18 +14,20 @@ username=
 list=
 verify=
 LINES=0
-while case "$#" in 0) break ;; esac
-do
+while [ $# -ne 0 ]; do
     case "$1" in
     -a)
 	annotate=1
+	shift
 	;;
     -s)
 	annotate=1
 	signed=1
+	shift
 	;;
     -f)
 	force=1
+	shift
 	;;
     -n)
         case $2 in
@@ -36,6 +38,7 @@ do
 		[ -z "$LINES" ] && LINES=1 # 1 line is default when -n is used
 		;;
 	esac
+	shift
 	;;
     -l)
 	list=1
@@ -122,7 +125,6 @@ do
 	break
 	;;
     esac
-    shift
 done
 
 [ -n "$list" ] && exit 0
-- 
1.5.2.1.144.gabc40
Next: Junio C Hamano
Message 1 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.