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

git describe/contains for submodule commits

From
Jacob Keller <jacob.keller@gmail.com>
Date
May 22, 2019, 23:42 UTC
Message-ID
<CA+P7+xrXz7-TgV4ufVkXqjgi8X1UD=pQJC3s2JA5fH-sEEnENA@mail.gmail.com>
Hi,

I've had a few times where I was curious of when a submodule got set to a specific commit.

I noticed that git describe has "blob" support, which outputs something like
<commit>:/path/to/file
using the revision walking machinery.

I'm curious if anyone knows if that sort of revision walk could be expected to find the first treeish that had a submodule commit instead of a blob.

I'm not that familiar with the revision walking, so I was hoping to get some pointers of whre to look before I began implementing.

Ultimately, I'd like to have some sort of command like:
  git submodule contains <submodule> <commit id>

and have it try to figure out the most recent commit htat has a submodule change for which the submodule is a child of the specified submodule commit.

I can sort of reverse engineer this through git log, but it's slow and tedious, so I was hoping to be able to implement it into a revision walk that did this.

Once I know the commit that introduces the submodule change, I could feed that to git describe --contains to find the tag/version which included the change easily enough.

Thanks, Jake

Next: Ævar Arnfjörð Bjarmason
Message 1 of 3 in “git describe/contains for submodule commits”
  1. Jacob KellerMay 22, 2019
  2. Ævar Arnfjörð BjarmasonMay 23, 2019
  3. Jacob KellerMay 29, 2019

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.