git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alf Clement" <alf.clement@gmail.com>
To: git@vger.kernel.org
Subject: Re: current repository hash
Date: Mon, 16 Jun 2008 20:30:16 +0200	[thread overview]
Message-ID: <556d90580806161130g62269318i46f00e5c7f79b7d9@mail.gmail.com> (raw)
In-Reply-To: <8aa486160806160515p751b2af4j2b0db6db7a9ad482@mail.gmail.com>

Hi all,

thanks for the tips.

When I run describe I get an error:
$ git describe --debug HEAD
fatal: cannot describe '792815de6e3c2403f1e2ed5f2264ca88a0ae7000'

Any hints why? I have a tag v1.3 attached to HEAD and all commited.

CU,
Alf

On Mon, Jun 16, 2008 at 2:15 PM, Santi Béjar <sbejar@gmail.com> wrote:
> On Mon, Jun 16, 2008 at 13:51, Alf Clement <alf.clement@gmail.com> wrote:
>> Hi all,
>>
>> I want to compile the current repository hash id into my program, to
>> be able to checkout later this
>> id an see the exact files for the compile. It should flag if there are
>> currently modified files in the
>> directory tree.
>
> You can look at how git does it:
>
> http://git.kernel.org/?p=git/git.git;a=blob;f=GIT-VERSION-GEN;hb=HEAD
>
>>
>> What would be the best command to get a unique identifier?
>
> "git rev-parse HEAD" for a unique identifier,
> but "git describe" is more convenient/useful.
>
>> Do I need the 40 digit hash id?
>
> Normally 7 or 8 are sufficient.
>
>> How can I make sure that a shorter hash id will be unique?
>
> You can't. Even the 40 digit hash is "only" cryptographically unique.
> But within a project 7 or 8 digits are unique enough for practical
> use.
>
> Santi
>

  reply	other threads:[~2008-06-16 18:31 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 [this message]
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=556d90580806161130g62269318i46f00e5c7f79b7d9@mail.gmail.com \
    --to=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).