From: "David Tweed" <david.tweed@gmail.com>
To: "Alf Clement" <alf.clement@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: current repository hash
Date: Mon, 16 Jun 2008 13:11:46 +0100 [thread overview]
Message-ID: <e1dab3980806160511s1a9a5192gbdf6539205ef1865@mail.gmail.com> (raw)
In-Reply-To: <556d90580806160451g36daefb6o48b93b92589211bf@mail.gmail.com>
On Mon, Jun 16, 2008 at 12:51 PM, Alf Clement <alf.clement@gmail.com> wrote:
> What would be the best command to get a unique identifier?
Note that git itself does this via the GIT-VERSION-GEN script so you
could look at that for ideas.
> How can I make sure that a shorter hash id will be unique?
Theoretically isn't that going to be tricky, as you don't just want
something that's unique at the time you compile the program but which
won't potentially be rendered non-unique by later commits (after
you've released your binary)? If you just want to be reasonably sure
you can truncate the hash to the length you'd like, eg "addcc13a" for
8 characters and run
git rev-parse addcc13a
and see if it says
addcc13a
fatal: ambiguous argument 'addcc13a': unknown revision or path not in
the working tree.
Use '--' to separate paths from revisions
--
cheers, dave tweed__________________________
david.tweed@gmail.com
Rm 124, School of Systems Engineering, University of Reading.
"while having code so boring anyone can maintain it, use Python." --
attempted insult seen on slashdot
next prev parent reply other threads:[~2008-06-16 12:13 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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e1dab3980806160511s1a9a5192gbdf6539205ef1865@mail.gmail.com \
--to=david.tweed@gmail.com \
--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.
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).