git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Gitk feature - show nearby tags

From
Junio C Hamano <junkio@cox.net>
Date
Jun 4, 2006, 09:21 UTC
Message-ID
<7vodx9cm3g.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<e5bfff550606030416s2ef6182crbde1395dd29e5b94@mail.gmail.com>
"Marco Costalba" <mcostalba@gmail.com> writes:
Show 14 quoted lines
> 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?

Previous: Marco CostalbaNext: Marco Costalba
Message 8 of 29 in “Gitk feature - show nearby tags”
  1. Paul MackerrasJun 3, 2006
  2. Junio C HamanoJun 3, 2006
  3. Marco CostalbaJun 3, 2006
  4. Paul MackerrasJun 4, 2006
  5. Marco CostalbaJun 4, 2006
  6. Junio C HamanoJun 4, 2006
  7. Marco CostalbaJun 4, 2006
  8. Junio C HamanoJun 4, 2006
  9. Marco CostalbaJun 4, 2006
  10. Junio C HamanoJun 4, 2006
  11. Junio C HamanoJun 4, 2006
  12. Marco CostalbaJun 4, 2006
  13. Marco CostalbaJun 4, 2006
  14. Junio C HamanoJun 4, 2006
  15. Marco CostalbaJun 4, 2006
  16. Junio C HamanoJun 5, 2006
  17. Marco CostalbaJun 5, 2006
  18. Paul MackerrasJun 3, 2006
  19. Junio C HamanoJun 3, 2006
  20. Paul MackerrasJun 4, 2006
  21. Jonas FonsecaJun 3, 2006
  22. Jakub NarebskiJun 3, 2006
  23. Jonas FonsecaJun 3, 2006
  24. Junio C HamanoJun 4, 2006
  25. Jonas FonsecaJun 5, 2006
  26. Junio C HamanoJun 5, 2006
  27. Junio C HamanoJun 5, 2006
  28. Jonas FonsecaJun 5, 2006
  29. Jonas FonsecaJun 5, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.