git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / Atom feed
* git describe/contains for submodule commits
@ 2019-05-22 23:42 Jacob Keller
  2019-05-23  0:04 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 3+ messages in thread
From: Jacob Keller @ 2019-05-22 23:42 UTC (permalink / raw)
  To: Git mailing list

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git describe/contains for submodule commits
  2019-05-22 23:42 git describe/contains for submodule commits Jacob Keller
@ 2019-05-23  0:04 ` Ævar Arnfjörð Bjarmason
  2019-05-29 17:32   ` Jacob Keller
  0 siblings, 1 reply; 3+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2019-05-23  0:04 UTC (permalink / raw)
  To: Jacob Keller; +Cc: Git mailing list


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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git describe/contains for submodule commits
  2019-05-23  0:04 ` Ævar Arnfjörð Bjarmason
@ 2019-05-29 17:32   ` Jacob Keller
  0 siblings, 0 replies; 3+ messages in thread
From: Jacob Keller @ 2019-05-29 17:32 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Git mailing list

On Wed, May 22, 2019 at 5:04 PM Ævar Arnfjörð Bjarmason
<avarab@gmail.com> wrote:
>
>
> 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.

Thanks, I'll take a look at this.

Regards,
Jake

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-29 17:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-22 23:42 git describe/contains for submodule commits Jacob Keller
2019-05-23  0:04 ` Ævar Arnfjörð Bjarmason
2019-05-29 17:32   ` Jacob Keller

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git