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

[PATCH] tag: grok "--with" as synonym to "--contains"

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 7, 2014, 20:07 UTC
Message-ID
<xmqqr46du60n.fsf@gitster.dls.corp.google.com>

Just like "git branch" can be told to list the branches that has the named commit by "git branch --with <commit>", teach the same short-hand to "git tag", so that "git tag --with <commit>" shows the releases with the named commit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * After umpteenth time I got an optparse error I finally decided
   that this may be worth consideration.
   Just like "git branch", the synonym is not advertised in the
   documentation nor "git cmd -h" output.  We _might_ want to expose
   both at the same time, but that is not in the scope of this patch.
 builtin/tag.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/builtin/tag.c b/builtin/tag.c
index af3af3f..cb7bb2b 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -471,6 +471,12 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
 			parse_opt_with_commit, (intptr_t)"HEAD",
 		},
 		{
+			OPTION_CALLBACK, 0, "with", &with_commit, N_("commit"),
+			N_("print only tags that contain the commit"),
+			PARSE_OPT_HIDDEN | PARSE_OPT_LASTARG_DEFAULT,
+			parse_opt_with_commit, (intptr_t)"HEAD",
+		},
+		{
 			OPTION_CALLBACK, 0, "points-at", NULL, N_("object"),
 			N_("print only tags of the object"), 0, parse_opt_points_at
 		},
Message 1 of 1 in “tag: grok "--with" as synonym to "--contains"”
  1. tag: grok "--with" as synonym to "--contains"Junio C Hamano, Mar 7, 2014

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.