tag: grok "--with" as synonym to "--contains"
authorJunio C Hamano <gitster@pobox.com>
Fri, 7 Mar 2014 20:07:35 +0000 (12:07 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 7 Mar 2014 20:52:02 +0000 (12:52 -0800)
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>
builtin/tag.c
index 74d3780b77548fc8a7bb2f51b47a51cbfb51969a..74d599c2d9d581d5889bcf19b26ab1262dd3c267 100644 (file)
@@ -470,6 +470,12 @@ int cmd_tag(int argc, const char **argv, const char *prefix)
                        PARSE_OPT_LASTARG_DEFAULT,
                        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