git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Adam Mercer <ramercer@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Getting the commit that corresponds to a specific annotated tag
Date: Fri, 01 Jun 2012 15:00:04 -0700	[thread overview]
Message-ID: <7vd35i1ymz.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CA+mfgz2=ZFBetSGv1Bkq6orBbpVTS1k0gLVm0nGoR1sUDkDwqQ@mail.gmail.com> (Adam Mercer's message of "Fri, 1 Jun 2012 16:47:43 -0500")

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.

  reply	other threads:[~2012-06-01 22:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2012-06-01 22:11   ` Adam Mercer
2012-06-01 22:21     ` Junio C Hamano
2012-06-01 22:27       ` Adam Mercer

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=7vd35i1ymz.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=ramercer@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 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).