{"thread":{"id":"51156","subject":"git describe/contains for submodule commits","startedAt":"2019-05-22T23:42:24Z","lastAt":"2019-05-29T17:32:41Z","messageCount":3,"participants":["Jacob Keller","Ævar Arnfjörð Bjarmason"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"376084","messageId":"CA+P7+xrXz7-TgV4ufVkXqjgi8X1UD=pQJC3s2JA5fH-sEEnENA@mail.gmail.com","threadId":"51156","inReplyTo":null,"subject":"git describe/contains for submodule commits","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2019-05-22T23:42:10Z","receivedAt":"2019-05-22T23:42:24Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"Hi,\n\nI've had a few times where I was curious of when a submodule got set\nto a specific commit.\n\nI noticed that git describe has \"blob\" support, which outputs something like\n\n<commit>:/path/to/file\n\nusing the revision walking machinery.\n\nI'm curious if anyone knows if that sort of revision walk could be\nexpected to find the first treeish that had a submodule commit instead\nof a blob.\n\nI'm not that familiar with the revision walking, so I was hoping to\nget some pointers of whre to look before I began implementing.\n\nUltimately, I'd like to have some sort of command like:\n\n  git submodule contains <submodule> <commit id>\n\nand have it try to figure out the most recent commit htat has a\nsubmodule change for which the submodule is a child of the specified\nsubmodule commit.\n\nI can sort of reverse engineer this through git log, but it's slow and\ntedious, so I was hoping to be able to implement it into a revision\nwalk that did this.\n\nOnce I know the commit that introduces the submodule change, I could\nfeed that to git describe --contains to find the tag/version which\nincluded the change easily enough.\n\nThanks,\nJake\n"},{"id":"376086","messageId":"8736l6ujcr.fsf@evledraar.gmail.com","threadId":"51156","inReplyTo":"CA+P7+xrXz7-TgV4ufVkXqjgi8X1UD=pQJC3s2JA5fH-sEEnENA@mail.gmail.com","subject":"Re: git describe/contains for submodule commits","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-05-23T00:04:20Z","receivedAt":"2019-05-23T00:04:31Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Thu, May 23 2019, Jacob Keller wrote:\n\n> Hi,\n>\n> I've had a few times where I was curious of when a submodule got set\n> to a specific commit.\n>\n> I noticed that git describe has \"blob\" support, which outputs something like\n>\n> <commit>:/path/to/file\n>\n> using the revision walking machinery.\n>\n> I'm curious if anyone knows if that sort of revision walk could be\n> expected to find the first treeish that had a submodule commit instead\n> of a blob.\n>\n> I'm not that familiar with the revision walking, so I was hoping to\n> get some pointers of whre to look before I began implementing.\n>\n> Ultimately, I'd like to have some sort of command like:\n>\n>   git submodule contains <submodule> <commit id>\n>\n> and have it try to figure out the most recent commit htat has a\n> submodule change for which the submodule is a child of the specified\n> submodule commit.\n>\n> I can sort of reverse engineer this through git log, but it's slow and\n> tedious, so I was hoping to be able to implement it into a revision\n> walk that did this.\n>\n> Once I know the commit that introduces the submodule change, I could\n> feed that to git describe --contains to find the tag/version which\n> included the change easily enough.\n>\n> Thanks,\n> Jake\n\nYou can do this with --find-object, e.g. on git.git:\n\n    git log --find-object=855827c583bc30645ba427885caa40c5b81764d2\n\nPlugging that into describe.c should be fairly straightforward.\n"},{"id":"376407","messageId":"CA+P7+xovDWswGpM-E4tc2AmHsnpwRzK57Zs27bm-itjwrdehhg@mail.gmail.com","threadId":"51156","inReplyTo":"8736l6ujcr.fsf@evledraar.gmail.com","subject":"Re: git describe/contains for submodule commits","fromName":"Jacob Keller","fromEmail":"jacob.keller@gmail.com","sentAt":"2019-05-29T17:32:27Z","receivedAt":"2019-05-29T17:32:41Z","isPatch":false,"sender":{"key":"jacob.keller@gmail.com","avatar":"https://avatars.githubusercontent.com/u/874719?v=4"},"body":"On Wed, May 22, 2019 at 5:04 PM Ævar Arnfjörð Bjarmason\n<avarab@gmail.com> wrote:\n>\n>\n> On Thu, May 23 2019, Jacob Keller wrote:\n>\n> > Hi,\n> >\n> > I've had a few times where I was curious of when a submodule got set\n> > to a specific commit.\n> >\n> > I noticed that git describe has \"blob\" support, which outputs something like\n> >\n> > <commit>:/path/to/file\n> >\n> > using the revision walking machinery.\n> >\n> > I'm curious if anyone knows if that sort of revision walk could be\n> > expected to find the first treeish that had a submodule commit instead\n> > of a blob.\n> >\n> > I'm not that familiar with the revision walking, so I was hoping to\n> > get some pointers of whre to look before I began implementing.\n> >\n> > Ultimately, I'd like to have some sort of command like:\n> >\n> >   git submodule contains <submodule> <commit id>\n> >\n> > and have it try to figure out the most recent commit htat has a\n> > submodule change for which the submodule is a child of the specified\n> > submodule commit.\n> >\n> > I can sort of reverse engineer this through git log, but it's slow and\n> > tedious, so I was hoping to be able to implement it into a revision\n> > walk that did this.\n> >\n> > Once I know the commit that introduces the submodule change, I could\n> > feed that to git describe --contains to find the tag/version which\n> > included the change easily enough.\n> >\n> > Thanks,\n> > Jake\n>\n> You can do this with --find-object, e.g. on git.git:\n>\n>     git log --find-object=855827c583bc30645ba427885caa40c5b81764d2\n>\n> Plugging that into describe.c should be fairly straightforward.\n\nThanks, I'll take a look at this.\n\nRegards,\nJake\n"}]}