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

[PATCH] git-tag: fix -l switch handling regression.

From
Pierre Habouzit <madcoder@debian.org>
Date
Dec 21, 2007, 10:50 UTC
Message-ID
<20071221105058.GD17701@artemis.madism.org>
In-Reply-To
<20071221104704.GC17701@artemis.madism.org>
Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---

It seems that you didnt took that patch either, that IMHO gives a better semantics to git tag -l than yours, while keeping backward compatibility.

 builtin-tag.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/builtin-tag.c b/builtin-tag.c
index 274901a..020ee1c 100644
--- a/builtin-tag.c
+++ b/builtin-tag.c
@@ -16,7 +16,7 @@
 static const char * const git_tag_usage[] = {
 	"git-tag [-a|-s|-u <key-id>] [-f] [-m <msg>|-F <file>] <tagname> [<head>]",
 	"git-tag -d <tagname>...",
-	"git-tag [-n [<num>]] -l [<pattern>]",
+	"git-tag -l [-n [<num>]] [<pattern>]",
 	"git-tag -v <tagname>...",
 	NULL
 };
@@ -370,13 +370,11 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 	struct ref_lock *lock;
 
 	int annotate = 0, sign = 0, force = 0, lines = 0,
-					delete = 0, verify = 0;
-	char *list = NULL, *msgfile = NULL, *keyid = NULL;
-	const char *no_pattern = "NO_PATTERN";
+		list = 0, delete = 0, verify = 0;
+	char *msgfile = NULL, *keyid = NULL;
 	struct msg_arg msg = { 0, STRBUF_INIT };
 	struct option options[] = {
-		{ OPTION_STRING, 'l', NULL, &list, "pattern", "list tag names",
-			PARSE_OPT_OPTARG, NULL, (intptr_t) no_pattern },
+		OPT_BOOLEAN('l', NULL, &list, "list tag names"),
 		{ OPTION_INTEGER, 'n', NULL, &lines, NULL,
 				"print n lines of each tag message",
 				PARSE_OPT_OPTARG, NULL, 1 },
@@ -408,7 +406,7 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 		annotate = 1;
 
 	if (list)
-		return list_tags(list == no_pattern ? NULL : list, lines);
+		return list_tags(argv[0], lines);
 	if (delete)
 		return for_each_tag_name(argv, delete_tag);
 	if (verify)
-- 
1.5.4.rc1.1096.g37c7b
Previous: Pierre HabouzitNext: Junio C Hamano
Message 8 of 19 in “1.5.4-rc2 plans”
  1. Junio C HamanoDec 21, 2007
  2. Johannes SixtDec 21, 2007
  3. Mike FrysingerDec 21, 2007
  4. Johannes SchindelinDec 22, 2007
  5. Mike FrysingerDec 22, 2007
  6. Steven GrimmDec 21, 2007
  7. Pierre HabouzitDec 21, 2007
  8. git-tag: fix -l switch handling regression.Pierre Habouzit, Dec 21, 2007
  9. Junio C HamanoDec 21, 2007
  10. Pierre HabouzitDec 21, 2007
  11. Junio C HamanoDec 22, 2007
  12. Junio C HamanoDec 21, 2007
  13. Pierre HabouzitDec 21, 2007
  14. parse-options: Add a gitcli(5) man page.Pierre Habouzit, Dec 21, 2007
  15. Johannes SchindelinDec 22, 2007
  16. Pierre HabouzitDec 22, 2007
  17. Junio C HamanoDec 22, 2007
  18. Pierre HabouzitDec 22, 2007
  19. Junio C HamanoDec 22, 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.