From: Marco Costalba Date: Sat, 03 Jun 2006 11:16:45 GMT Subject: Re: Gitk feature - show nearby tags Message-ID: In-Reply-To: <7vslmm8rcd.fsf@assigned-by-dhcp.cox.net> On 6/3/06, Junio C Hamano wrote: > Paul Mackerras writes: > > > I just pushed out an update to the "new" branch of the gitk.git > > repository, which adds a feature that I have often wished for: it will > > now show the nearest preceding and following tags when you select a > > commit. This is very useful if you need to identify which release was > > the first to incorporate a particular patch, or if you need to know > > which release a patch might have been based on. > > Another thing that would equally be useful is to show which > branch a particular commit is on, so for example I can pick one > commit while doing "gitk next" to view the next branch and see > which topic it belongs to, and "gitk this-topic" to see which > commits on that topic, if any, are not yet in the "next" branch. > If I have understood correctly the patch runs a 'git rev-list --all --topo-order --parents' and then does a tree walking. I am wandering if there exist any native git way to found the previous tag. As example given a selected revision with id is it possible to do something like this to fond the ancestor? 1) get the tag list with git-peek-remote or something similar if tags are not already loaded 2) given the tagList vector with n elements run git-rev-list --topo-order ^tagList[0] ^tagList[1] .... ^tagList[n-1] 3) take the last sha spit out by git-rev-list, be it . 4) Previous nearest tag is the parent of lastSha I've missed something? Marco