From: Junio C Hamano Date: Sun, 25 Jun 2017 22:22:58 GMT Subject: Re: Getting first tag per branch for a commit Message-ID: In-Reply-To: Junio C Hamano writes: > Orgad Shaneh 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.