# with git 1.8.3.1 get only merged tags

5 messages from 2018-09-11 to 2018-09-14. Participants: Michal Novotny, Jeff King, Ævar Arnfjörð Bjarmason.
Thread: https://gitlist.dev/t/49315

## Michal Novotny, 2018-09-11 10:43

Subject: with git 1.8.3.1 get only merged tags
Message-ID: <CANT8FXRbep_32-eeMSa0C1e6q6MUvFddgTUiUgqv54J-2c+iXg@mail.gmail.com>
URL: https://gitlist.dev/e/CANT8FXRbep_32-eeMSa0C1e6q6MUvFddgTUiUgqv54J-2c%2BiXg%40mail.gmail.com

```
Hello,

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?

Thank you
clime

```

## Jeff King, 2018-09-11 19:05

Subject: Re: with git 1.8.3.1 get only merged tags
Message-ID: <20180911190519.GA8396@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20180911190519.GA8396%40sigill.intra.peff.net
In-Reply-To: <CANT8FXRbep_32-eeMSa0C1e6q6MUvFddgTUiUgqv54J-2c+iXg@mail.gmail.com>

```
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

-Peff

```

## Michal Novotny, 2018-09-13 08:36

Subject: Re: with git 1.8.3.1 get only merged tags
Message-ID: <CANT8FXSu9rqbw5D05LfcrD1GpenFGdB6TAcaHJGFJiouzctxJQ@mail.gmail.com>
URL: https://gitlist.dev/e/CANT8FXSu9rqbw5D05LfcrD1GpenFGdB6TAcaHJGFJiouzctxJQ%40mail.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:
>
> 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

```

## Ævar Arnfjörð Bjarmason, 2018-09-13 11:27

Subject: Re: with git 1.8.3.1 get only merged tags
Message-ID: <87lg85ljsc.fsf@evledraar.gmail.com>
URL: https://gitlist.dev/e/87lg85ljsc.fsf%40evledraar.gmail.com
In-Reply-To: <CANT8FXRbep_32-eeMSa0C1e6q6MUvFddgTUiUgqv54J-2c+iXg@mail.gmail.com>

```

On Tue, Sep 11 2018, 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

Jeff answer the question you had, but I just have one of my own: Is
RedHat stuck on 1.8-era git in some release it's still maintaining, does
this mean that e.g. you're still backporting security fixes to this
2012-era release?

```

## Michal Novotny, 2018-09-14 10:47

Subject: Re: with git 1.8.3.1 get only merged tags
Message-ID: <CANT8FXQrrgj=iVV0tX=MO9LH+=joQUfJmtDeACwyQjNT93e0aw@mail.gmail.com>
URL: https://gitlist.dev/e/CANT8FXQrrgj%3DiVV0tX%3DMO9LH%2B%3DjoQUfJmtDeACwyQjNT93e0aw%40mail.gmail.com
In-Reply-To: <87lg85ljsc.fsf@evledraar.gmail.com>

```
On Thu, Sep 13, 2018 at 1:27 PM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
>
> On Tue, Sep 11 2018, 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
>
> Jeff answer the question you had, but I just have one of my own: Is
> RedHat stuck on 1.8-era git in some release it's still maintaining, does
> this mean that e.g. you're still backporting security fixes to this
> 2012-era release?

Yes, that's exactly the case with RHEL-7.

clime

```
