From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Jacob Keller <jacob.keller@gmail.com>
Cc: Git mailing list <git@vger.kernel.org>
Subject: Re: git describe/contains for submodule commits
Date: Thu, 23 May 2019 02:04:20 +0200 [thread overview]
Message-ID: <8736l6ujcr.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <CA+P7+xrXz7-TgV4ufVkXqjgi8X1UD=pQJC3s2JA5fH-sEEnENA@mail.gmail.com>
On Thu, May 23 2019, Jacob Keller wrote:
> 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
You can do this with --find-object, e.g. on git.git:
git log --find-object=855827c583bc30645ba427885caa40c5b81764d2
Plugging that into describe.c should be fairly straightforward.
next prev parent reply other threads:[~2019-05-23 0:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-22 23:42 git describe/contains for submodule commits Jacob Keller
2019-05-23 0:04 ` Ævar Arnfjörð Bjarmason [this message]
2019-05-29 17:32 ` Jacob Keller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8736l6ujcr.fsf@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=jacob.keller@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.