git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Orgad Shaneh <orgads@gmail.com>
To: git <git@vger.kernel.org>
Subject: Getting first tag per branch for a commit
Date: Sun, 25 Jun 2017 17:06:41 +0300	[thread overview]
Message-ID: <CAGHpTBLP9MiYr2ZoUOaGjGMC+aO_EKYO6SwNLfAu6QFSRnPatQ@mail.gmail.com> (raw)

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

             reply	other threads:[~2017-06-25 14:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-25 14:06 Orgad Shaneh [this message]
2017-06-25 21:54 ` Getting first tag per branch for a commit Junio C Hamano
2017-06-25 22:22   ` Junio C Hamano
2017-06-26  9:37   ` Orgad Shaneh

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGHpTBLP9MiYr2ZoUOaGjGMC+aO_EKYO6SwNLfAu6QFSRnPatQ@mail.gmail.com \
    --to=orgads@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).