git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Getting first tag per branch for a commit
@ 2017-06-25 14:06 Orgad Shaneh
  2017-06-25 21:54 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Orgad Shaneh @ 2017-06-25 14:06 UTC (permalink / raw)
  To: git

Hi,

git describe --tags <commit> gives me the first tag that includes this commit.

git tag --contains <commit> shows all the tags that contain the commit.

git branch -a --contains <commit> shows the branches that include this commit.

What I'd like to have is a way to tell the first tag per branch (or
per merge) that the commit appeared on.

I'll use an example from the Git repository. Let's pick commit
32b8c581ec which was first introduced in v2.9.3.

git describe --tags will only show v2.9.3

git tag --contains shows the following list:
v2.10.0
v2.10.0-rc0
v2.10.0-rc1
v2.10.0-rc2
v2.10.1
v2.10.2
v2.10.3
v2.11.0
v2.11.0-rc0
v2.11.0-rc1
v2.11.0-rc2
v2.11.0-rc3
v2.11.1
v2.11.2
v2.12.0
v2.12.0-rc0
v2.12.0-rc1
v2.12.0-rc2
v2.12.1
v2.12.2
v2.12.3
v2.13.0
v2.13.0-rc0
v2.13.0-rc1
v2.13.0-rc2
v2.13.1
v2.13.2
v2.9.3
v2.9.4

What really interests me as a user is the "first in the series" tag
for each version. What I'd expect is:
v2.10.0-rc0
v2.9.3

and I can conclude that if it appeared in 2.9.3 then 2.9.4 also has
it, and if it's in 2.10.0-rc0 then all the following versions (2.10.x
and up) include it.

I think that this can be done by filtering out tags that are connected
to already listed tags by first-parent link.

Is there a way to achieve this kind of "simplified contained in" list?

Related: https://bugs.chromium.org/p/gerrit/issues/detail?id=4331

- Orgad

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-06-26  9:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-25 14:06 Getting first tag per branch for a commit Orgad Shaneh
2017-06-25 21:54 ` Junio C Hamano
2017-06-25 22:22   ` Junio C Hamano
2017-06-26  9:37   ` Orgad Shaneh

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).