From: Marco Costalba Date: Sun, 04 Jun 2006 10:42:16 GMT Subject: Re: Gitk feature - show nearby tags Message-ID: In-Reply-To: On 6/4/06, Marco Costalba wrote: > On 6/4/06, Junio C Hamano wrote: > > "Marco Costalba" writes: > > > > > In a less corner case, just to better explaing my idea, consider this: > > > > > > a---b---d---e---f---g---h > > > t1 \ / t3 > > > ---c > > > t2 > > > > > > Where our sha1 is still "e", in this case > > > > > > git-rev-list --topo-order ^a ^c ^g > > > > > > gives, as last revision in output list, "f" > > > Then parentOf() is and our looked for tag is t3 > > > > Sorry, in the example time flows from left to right. If you > > exclude g then you are excluding everything that is reachable > > from g so you would not see "f". To better explain what I mean, that's the algorithm : cmd = "git-rev-list --topo-order --parents " + sha; for (uint i = 0; i < tagList.count(); i++) cmd.append(" ^" + tagList[i]); output = run(cmd); if (output.isEmpty()) { parent = parentOf(sha); return (parent && parent->isTag()) ? parent->tag() : NO_TAG; } lastSha = getLastLine(output); parent = parentOf(lastSha); return (parent && parent->isTag()) ? parent->tag() : NO_TAG;