git@vger.kernel.org mailing list mirror (one of many)
 help / Atom feed
* with git 1.8.3.1 get only merged tags
@ 2018-09-11 10:43 Michal Novotny
  2018-09-11 19:05 ` Jeff King
  2018-09-13 11:27 ` Ævar Arnfjörð Bjarmason
  0 siblings, 2 replies; 5+ messages in thread
From: Michal Novotny @ 2018-09-11 10:43 UTC (permalink / raw)
  To: git

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

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

* Re: with git 1.8.3.1 get only merged tags
  2018-09-11 10:43 with git 1.8.3.1 get only merged tags Michal Novotny
@ 2018-09-11 19:05 ` Jeff King
  2018-09-13  8:36   ` Michal Novotny
  2018-09-13 11:27 ` Ævar Arnfjörð Bjarmason
  1 sibling, 1 reply; 5+ messages in thread
From: Jeff King @ 2018-09-11 19:05 UTC (permalink / raw)
  To: Michal Novotny; +Cc: git

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

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

* Re: with git 1.8.3.1 get only merged tags
  2018-09-11 19:05 ` Jeff King
@ 2018-09-13  8:36   ` Michal Novotny
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Novotny @ 2018-09-13  8:36 UTC (permalink / raw)
  To: peff; +Cc: git

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

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

* Re: with git 1.8.3.1 get only merged tags
  2018-09-11 10:43 with git 1.8.3.1 get only merged tags Michal Novotny
  2018-09-11 19:05 ` Jeff King
@ 2018-09-13 11:27 ` Ævar Arnfjörð Bjarmason
  2018-09-14 10:47   ` Michal Novotny
  1 sibling, 1 reply; 5+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2018-09-13 11:27 UTC (permalink / raw)
  To: Michal Novotny; +Cc: git, Jeff King


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?

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

* Re: with git 1.8.3.1 get only merged tags
  2018-09-13 11:27 ` Ævar Arnfjörð Bjarmason
@ 2018-09-14 10:47   ` Michal Novotny
  0 siblings, 0 replies; 5+ messages in thread
From: Michal Novotny @ 2018-09-14 10:47 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git, Jeff King

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

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

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 10:43 with git 1.8.3.1 get only merged tags Michal Novotny
2018-09-11 19:05 ` Jeff King
2018-09-13  8:36   ` Michal Novotny
2018-09-13 11:27 ` Ævar Arnfjörð Bjarmason
2018-09-14 10:47   ` Michal Novotny

git@vger.kernel.org mailing list mirror (one of many)

Archives are clonable:
	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.org/gmane.comp.version-control.git

 note: .onion URLs require Tor: https://www.torproject.org/
       or Tor2web: https://www.tor2web.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox