From: Jeff King <peff@peff.net>
To: CoDEmanX <codemanx@gmx.de>
Cc: Karthik Nayak <karthik.188@gmail.com>, git@vger.kernel.org
Subject: Re: List tags for a certain branch
Date: Sun, 23 Aug 2015 13:07:52 -0400 [thread overview]
Message-ID: <20150823170751.GA24194@sigill.intra.peff.net> (raw)
In-Reply-To: <55D9E672.4050503@gmx.de>
On Sun, Aug 23, 2015 at 05:27:46PM +0200, CoDEmanX wrote:
> the question how to list tags, that point to commits contained in a certain
> branch came up on StackOverflow couple times, and this appears to be the
> only fast solution (example for local devel branch):
>
> git log --simplify-by-decoration --decorate --pretty=%d
> "refs/heads/devel" | fgrep 'tag: '
>
> It would be much much simpler, if the tag command supporter an optional
> parameter to specify a branch:
>
> git tag --list --branch devel
>
> It should result in something like:
>
> Test-Tag1
> Test-Tag2
> Test-Tag3
> Another-Tag
> And-Another
I think the option you are looking for is "--merged", which currently
only the "branch" command nows about. So right now you can do:
git branch --merged devel
to get a list of branches that are contained in "devel". There is work
underway to unify the selection/filter code for git-branch and git-tag,
so in a future version of git you should be able to do "git tag
--merged" to get the tags that are "merged" to a particular branch.
-Peff
PS I'm not sure if we should pick a more generic name than "--merged"
when git-tag learns this feature. For branches, it makes sense to ask
"which branches are merged to this other branch". But the operation is
really "which items are ancestors of the commit I gave". It is the
opposite of "--contains" in that sense. Sort of a "--contained-in".
next prev parent reply other threads:[~2015-08-23 17:08 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-23 15:27 List tags for a certain branch CoDEmanX
2015-08-23 17:07 ` Jeff King [this message]
2015-08-23 18:06 ` CoDEmanX
2015-08-23 18:58 ` Jeff King
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150823170751.GA24194@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=codemanx@gmx.de \
--cc=git@vger.kernel.org \
--cc=karthik.188@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).