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

Re: List tags for a certain branch

From
CCoDEmanX <codemanx@gmx.de>
Date
Aug 23, 2015, 18:06 UTC
Message-ID
<0322fd40-7473-4faa-840f-8be27f555435@email.android.com>
In-Reply-To
<20150823170751.GA24194@sigill.intra.peff.net>
> in a future version of git you should be able to do "git tag 
--merged" to get the tags that are "merged" to a particular branch. 
Would it return every tag in the branch, even if it was created in that branch, and not merged from somewhere else? If no, than it's not what I am looking for. 
(Or more precisely: would it give a list of all tags, that point to commits present in the specified branch, regardless of whether these commits were originally done in that branch or merged from another branch? I hope my understanding of git is correct here...)
I was able to achieve my goal with a Python script, that
- gets a list of all commit hashes for a given branch and creates a set
- creates a dictionary / hashmap from refs/tags/*, using commit hashes as keys and tag names as values
- creates a set from dictionary keys
- does an intersection operation using both sets
- and maps the remaining hashes back to tag names.
See the updated SO question:
http://stackoverflow.com/a/32169239/2044940
Thank you Peff!
Previous: Jeff KingNext: Jeff King
Message 3 of 4 in “List tags for a certain branch”
  1. CoDEmanXAug 23, 2015
  2. Jeff KingAug 23, 2015
  3. CoDEmanXAug 23, 2015
  4. Jeff KingAug 23, 2015

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.