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 <gits...@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
                },
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to