Re: Getting the commit that corresponds to a specific annotated tag

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: Getting the commit that corresponds to a specific annotated tag

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:53:58

Adam Mercer [off-list ref] 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.

Re: Getting the commit that corresponds to a specific annotated tag

From: Adam Mercer <hidden>
Date: 2016-06-15 22:53:58

On Fri, Jun 1, 2012 at 5:00 PM, Junio C Hamano [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help