Re: Getting first tag per branch for a commit
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 25, 2017, 22:22 UTC
- Message-ID
- <xmqqd19r7lml.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <xmqqy3sf7mxo.fsf@gitster.mtv.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 14 quoted lines
> Orgad Shaneh <orgads@gmail.com> writes: > >> 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 think that this can be done by filtering out tags that are connected >> to already listed tags by first-parent link. > > Yes. When one tag can be reached by another tag, then the former is > definitely an earlier tag than the latter. > > A trivial way to compute it would require O(n^2) invocations of "git > merge-base --is-ancestor". Alternatively, I think you can perhaps > use "git merge-base --independent".
Ah, forget the latter. "independent" is about solving the opposite use case--it is to cull the ones that can be reached by other tips.