summaryrefslogtreecommitdiff
path: root/builtin/tag.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-07 20:07:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-03-07 20:52:02 (GMT)
commitb0bc1365c29ea3328329ad45aba9e86cd7575af6 (patch)
tree98e9b443d73bb25eb89d6b58d04fd108c543a3cc /builtin/tag.c
parent5f95c9f850b19b368c43ae399cc831b17a26a5ac (diff)
downloadgit-b0bc1365c29ea3328329ad45aba9e86cd7575af6.zip
git-b0bc1365c29ea3328329ad45aba9e86cd7575af6.tar.gz
git-b0bc1365c29ea3328329ad45aba9e86cd7575af6.tar.bz2
tag: grok "--with" as synonym to "--contains"
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>
Diffstat (limited to 'builtin/tag.c')
-rw-r--r--builtin/tag.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/builtin/tag.c b/builtin/tag.c
index 74d3780..74d599c 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
},