git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: with git 1.8.3.1 get only merged tags

From
MNMichal Novotny <clime@redhat.com>
Date
Sep 13, 2018, 08:36 UTC
Message-ID
<CANT8FXSu9rqbw5D05LfcrD1GpenFGdB6TAcaHJGFJiouzctxJQ@mail.gmail.com>
In-Reply-To
<20180911190519.GA8396@sigill.intra.peff.net>
On Tue, Sep 11, 2018 at 9:05 PM Jeff King <peff@peff.net> wrote:
Show 18 quoted lines
>
> On Tue, Sep 11, 2018 at 12:43:15PM +0200, Michal Novotny wrote:
>
> > I need to emulate git tag --merged with very old git 1.8.3.1. Is that
> > somehow possible?
> > I am looking for a bash function that would take what git 1.8.3.1
> > offers and return only the tags accessible from the current branch
> > tip. Could you, please, give me at least a hint how this could be
> > done?
>
> This is not particularly fast, but it should work:
>
>   git for-each-ref refs/tags |
>   cut -f2 |
>   while read tag; do
>     test "$(git merge-base $tag HEAD)" = \
>          "$(git rev-parse $tag^{commit})" && echo $tag
>   done
That works for me. Thank you a lot for help!
clime
>
> -Peff
Previous: Jeff KingNext: Ævar Arnfjörð Bjarmason
Message 3 of 5 in “with git 1.8.3.1 get only merged tags”
  1. Michal NovotnySep 11, 2018
  2. Jeff KingSep 11, 2018
  3. Michal NovotnySep 13, 2018
  4. Ævar Arnfjörð BjarmasonSep 13, 2018
  5. Michal NovotnySep 14, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.