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

Find the next tag on a given branch

From
MKmartin f krafft <madduck@madduck.net>
Date
Sep 9, 2010, 05:28 UTC
Message-ID
<20100909052841.GA16722@fishbowl.rw.madduck.net>
Dear list,

I want to find the next tag (the tag following a commit), but require that it lie on a given branch. Alternatively, a filter pattern might work too.

My challenge is to answer the question:
  "Which is the first Debian release including a given commit"

The way Debian packages are (mostly) maintained in Git is that there are at least an upstream and a Debian branch (usually "master"). master branched off upstream, and upstream is merged into master at regular intervals. Whenever a Debian release is made, the corresponding branch is tagged.

If I run
  git describe --contains mycommitish

it prints the next tag, which is usually upstream's tag, which is not quite what I want (it's usually enough for me to figure it out, but this is Git and so I should be able to do even better! ;\) )

I would like to have it continue the search until it reaches the master branch. For instance, a command like

  git describe --contains mycommit --on-branch master

would basically search into the future (breadth-first?) until it landed on the specified branch, and then continue the normal search routine (and find the commit on another branch actually, the important point is that it only started to search for tags once it reached the specified branch).

The alternative is
  git describe --contains mycommit --pattern='debian/*'

which would keep searching for tags until it found a tag/ref-name that matched the specified glob.

Is this already possible somehow? Am I simply looking at the wrong tools?

Thanks,
-- 
martin | http://madduck.net/ | http://two.sentenc.es/
 
i don't want to get myself into a hot babe situation.
                         -- jonathan mcdowll, #debian-uk, 6 jul 2009
 
spamtraps: madduck.bogus@madduck.net
Next: Thomas Rast
Message 1 of 4 in “Find the next tag on a given branch”
  1. martin f krafftSep 9, 2010
  2. Thomas RastSep 9, 2010
  3. martin f krafftSep 9, 2010
  4. Artur SkawinaSep 9, 2010

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.