Re: current repository hash

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: David Tweed
Date: Monday, June 16, 2008 - 5:11 am

On Mon, Jun 16, 2008 at 12:51 PM, Alf Clement <alf.clement@gmail.com> wrote:

Note that git itself does this via the GIT-VERSION-GEN script so you
could look at that for ideas.


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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
current repository hash, Alf Clement, (Mon Jun 16, 4:51 am)
Re: current repository hash, David Tweed, (Mon Jun 16, 5:11 am)
Re: current repository hash, Santi Béjar, (Mon Jun 16, 5:15 am)
Re: current repository hash, Jeff King, (Mon Jun 16, 8:04 am)
Re: current repository hash, Alf Clement, (Mon Jun 16, 11:30 am)
Re: current repository hash, Jeff King, (Mon Jun 16, 11:45 am)
Re: current repository hash, Alf Clement, (Mon Jun 16, 11:48 pm)
Re: current repository hash, Johan Herland, (Tue Jun 17, 12:07 am)
Re: current repository hash, Johannes Schindelin, (Tue Jun 17, 2:51 am)