threads / discuss / 49315

with git 1.8.3.1 get only merged tags

Subject: with git 1.8.3.1 get only merged tags

## tl;dr

5 messages between Sep 11, 2018 and Sep 14, 2018.

replies: 4people: 3as markdown or json

Michal Novotny· Sep 11, 2018, 10:43 UTC · lore
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· Sep 11, 2018, 19:05 UTC · re: Michal Novotny · lore

Re: with git 1.8.3.1 get only merged tags

On Tue, Sep 11, 2018 at 12:43:15PM +0200, Michal Novotny wrote:
Show 6 quoted lines
> 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· Sep 13, 2018, 08:36 UTC · re: Jeff King · lore

Re: with git 1.8.3.1 get only merged tags

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
Ævar Arnfjörð Bjarmason· Sep 13, 2018, 11:27 UTC · re: Michal Novotny · lore

Re: with git 1.8.3.1 get only merged tags

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· Sep 14, 2018, 10:47 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: with git 1.8.3.1 get only merged tags

On Thu, Sep 13, 2018 at 1:27 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:

Show 13 quoted lines
>
>
> 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

← back to recent threads