git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Charles Bailey <charles@hashpling.org>
To: Teemu Likonen <tlikonen@iki.fi>
Cc: Allan Kelly <allankelly@gmail.com>, git@vger.kernel.org
Subject: Re: Show current SHA1
Date: Sat, 11 Jul 2009 11:16:52 +0100	[thread overview]
Message-ID: <20090711101652.GA30698@hashpling.org> (raw)
In-Reply-To: <874otjlf22.fsf@iki.fi>

On Sat, Jul 11, 2009 at 12:55:17PM +0300, Teemu Likonen wrote:
> On 2009-07-11 10:39 (+0100), Allan Kelly wrote:
> 
> > The question then is: what is the command to report the current SHA1?
> > Note I never branch in the HTML repo, it's entirely linear.
> 
> If the "current SHA1" means "the SHA1 of the most recent commit in the
> current branch" then usually
> 
>     git show
> 
> is the simplest way. There are many ways to print _only_ the SHA1.
> Examples:
> 
>     git log -1 --pretty=format:%H
>     git rev-list -1 HEAD

For listing a single commit, I usually think of show and rev-parse
before using commands that list multiple commits. (Of course, having
to use --quiet doesn't make show any shorter than log -1.)

    git rev-parse HEAD
    git show --quiet --pretty=format:%H

-- 
Charles Bailey
http://ccgi.hashpling.plus.com/blog/

  reply	other threads:[~2009-07-11 10:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-11  9:39 Show current SHA1 Allan Kelly
2009-07-11  9:55 ` Teemu Likonen
2009-07-11 10:16   ` Charles Bailey [this message]
2009-07-11 11:36 ` Heinrich Nirschl

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=20090711101652.GA30698@hashpling.org \
    --to=charles@hashpling.org \
    --cc=allankelly@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=tlikonen@iki.fi \
    /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).