From: Jeff King <peff@peff.net>
To: Alf Clement <alf.clement@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: current repository hash
Date: Mon, 16 Jun 2008 11:04:17 -0400 [thread overview]
Message-ID: <20080616150416.GA6164@sigill.intra.peff.net> (raw)
In-Reply-To: <556d90580806160451g36daefb6o48b93b92589211bf@mail.gmail.com>
On Mon, Jun 16, 2008 at 01:51:52PM +0200, Alf Clement wrote:
> What would be the best command to get a unique identifier?
If you just want the commit sha1, then "git rev-list -1 HEAD" will give
it to you. But take a look at git-describe, which is designed to give a
nice human-readable name based on your tags.
> Do I need the 40 digit hash id?
No, but you increase your chances of a collision in the future. In
practice, 8 or 9 characters tends to give unique commits.
> How can I make sure that a shorter hash id will be unique?
git-describe will find the shortest unique hash. But bear in mind that
it may not be unique forever.
-Peff
next prev parent reply other threads:[~2008-06-16 15:05 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-16 11:51 current repository hash Alf Clement
2008-06-16 12:11 ` David Tweed
2008-06-16 12:15 ` Santi Béjar
2008-06-16 18:30 ` Alf Clement
2008-06-16 18:45 ` Jeff King
2008-06-17 6:48 ` Alf Clement
2008-06-17 7:07 ` Johan Herland
2008-06-16 15:04 ` Jeff King [this message]
2008-06-17 9:51 ` Johannes Schindelin
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080616150416.GA6164@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=alf.clement@gmail.com \
--cc=git@vger.kernel.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).