Re: Gitk feature - show nearby tags

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Marco Costalba" <mcostalba@xxxxxxxxx> writes:

> As example given a selected revision with id <sha> 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 <sha> ^tagList[0]  ^tagList[1]   ....
>  ^tagList[n-1]
>
> 3) take the last sha spit out by git-rev-list, be it <lastSha>.
>
> 4) Previous nearest tag is the parent of lastSha

Sorry, I do not understand what you are doing here at all.
Suppose you have this simple history.

  (root)

         a---b---d---e---f---g
         t1   \ /        t3        
            ---c
               t2

and <sha1> in (2) is "e".  When tagList = (t1, t2, t3), the
above rev-list would return empty.  For tagList = (t1, t2), the
rev-list would return "e", and then "d".  Parent of "d" are "b"
and "c", and c is tagged but b is not.  So if you are willing to
try 2^N permutations of what tagList to use, then the above
sequence, with a bit of tweak to step (4) to see which parents
are tagged, would yield the closest tag in the past of "e", but
is that what you are suggesting?

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]