{"thread":{"id":"36099","subject":"[PATCH] tag: grok \"--with\" as synonym to \"--contains\"","startedAt":"2014-03-07T20:07:35Z","lastAt":"2014-03-07T20:07:35Z","messageCount":1,"participants":["Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"236273","messageId":"xmqqr46du60n.fsf@gitster.dls.corp.google.com","threadId":"36099","inReplyTo":null,"subject":"[PATCH] tag: grok \"--with\" as synonym to \"--contains\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-03-07T20:07:35Z","receivedAt":"2014-03-07T20:07:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Just like \"git branch\" can be told to list the branches that has the\nnamed commit by \"git branch --with <commit>\", teach the same\nshort-hand to \"git tag\", so that \"git tag --with <commit>\" shows the\nreleases with the named commit.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * After umpteenth time I got an optparse error I finally decided\n   that this may be worth consideration.\n\n   Just like \"git branch\", the synonym is not advertised in the\n   documentation nor \"git cmd -h\" output.  We _might_ want to expose\n   both at the same time, but that is not in the scope of this patch.\n\n builtin/tag.c | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/builtin/tag.c b/builtin/tag.c\nindex af3af3f..cb7bb2b 100644\n--- a/builtin/tag.c\n+++ b/builtin/tag.c\n@@ -471,6 +471,12 @@ int cmd_tag(int argc, const char **argv, const char *prefix)\n \t\t\tparse_opt_with_commit, (intptr_t)\"HEAD\",\n \t\t},\n \t\t{\n+\t\t\tOPTION_CALLBACK, 0, \"with\", &with_commit, N_(\"commit\"),\n+\t\t\tN_(\"print only tags that contain the commit\"),\n+\t\t\tPARSE_OPT_HIDDEN | PARSE_OPT_LASTARG_DEFAULT,\n+\t\t\tparse_opt_with_commit, (intptr_t)\"HEAD\",\n+\t\t},\n+\t\t{\n \t\t\tOPTION_CALLBACK, 0, \"points-at\", NULL, N_(\"object\"),\n \t\t\tN_(\"print only tags of the object\"), 0, parse_opt_points_at\n \t\t},\n"}]}