git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Getting the commit that corresponds to a specific annotated tag
@ 2012-06-01 21:47 Adam Mercer
  2012-06-01 22:00 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Mercer @ 2012-06-01 21:47 UTC (permalink / raw)
  To: git

Hi

For some porcelain I'm writing I need to determine the commit that
corresponds to a given annotated tag, so far I have the following:

$ git cat-file tag <tag_name> | grep object | awk '{print $2}'

Is there already some pluming that performs this task?

Cheers

Adam

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

* Re: Getting the commit that corresponds to a specific annotated tag
  2012-06-01 21:47 Getting the commit that corresponds to a specific annotated tag Adam Mercer
@ 2012-06-01 22:00 ` Junio C Hamano
  2012-06-01 22:11   ` Adam Mercer
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2012-06-01 22:00 UTC (permalink / raw)
  To: Adam Mercer; +Cc: git

Adam Mercer <ramercer@gmail.com> writes:

> For some porcelain I'm writing I need to determine the commit that
> corresponds to a given annotated tag, so far I have the following:
>
> $ git cat-file tag <tag_name> | grep object | awk '{print $2}'
>
> Is there already some pluming that performs this task?

I think you want

	git rev-parse $tag^{commit}

It's kind of scary, though.

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

* Re: Getting the commit that corresponds to a specific annotated tag
  2012-06-01 22:00 ` Junio C Hamano
@ 2012-06-01 22:11   ` Adam Mercer
  2012-06-01 22:21     ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Adam Mercer @ 2012-06-01 22:11 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Fri, Jun 1, 2012 at 5:00 PM, Junio C Hamano <gitster@pobox.com> wrote:

> I think you want
>
>        git rev-parse $tag^{commit}
>
> It's kind of scary, though.

Thanks, that does the trick. Why do you say it's scary?

Cheers

Adam

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

* Re: Getting the commit that corresponds to a specific annotated tag
  2012-06-01 22:11   ` Adam Mercer
@ 2012-06-01 22:21     ` Junio C Hamano
  2012-06-01 22:27       ` Adam Mercer
  0 siblings, 1 reply; 5+ messages in thread
From: Junio C Hamano @ 2012-06-01 22:21 UTC (permalink / raw)
  To: Adam Mercer; +Cc: git

Adam Mercer <ramercer@gmail.com> writes:

> On Fri, Jun 1, 2012 at 5:00 PM, Junio C Hamano <gitster@pobox.com> wrote:
>
>> I think you want
>>
>>        git rev-parse $tag^{commit}
>>
>> It's kind of scary, though.
>
> Thanks, that does the trick. Why do you say it's scary?

Didn't you say you were writing a Porcelain?

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

* Re: Getting the commit that corresponds to a specific annotated tag
  2012-06-01 22:21     ` Junio C Hamano
@ 2012-06-01 22:27       ` Adam Mercer
  0 siblings, 0 replies; 5+ messages in thread
From: Adam Mercer @ 2012-06-01 22:27 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Fri, Jun 1, 2012 at 5:21 PM, Junio C Hamano <gitster@pobox.com> wrote:

> Didn't you say you were writing a Porcelain?

Ahh, I get you. Porcelain was probably the wrong word...

Cheers

Adam

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

end of thread, other threads:[~2012-06-01 22:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-01 21:47 Getting the commit that corresponds to a specific annotated tag Adam Mercer
2012-06-01 22:00 ` Junio C Hamano
2012-06-01 22:11   ` Adam Mercer
2012-06-01 22:21     ` Junio C Hamano
2012-06-01 22:27       ` Adam Mercer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).