Subject: Re: Stamp Git commit id into file during build process

From: Jakub Narebski <[email-masked]>
Date: Sat, 16 Jan 2010 22:27:22 +0100

Dnia sobota 16. stycznia 2010 22:12, Paul Richards napisał:
> 2010/1/16 Jakub Narebski <[email-masked]>:
>> Paul Richards <[email-masked]> writes:

>>> I am in the process of migrating from Subversion to Git.  One thing I
>>> am unsure of is how to stamp the 'version' or 'commit id' into a file
>>> as part of a build process.

>> Take a look how for example git project and Linux kernel use "git describe"
>> in GIT-VERSION-GEN script, and how they use GIT-VERSION-GEN script in the
>> Makefile. 
> 
> Thanks, it appears though that "git describe" does not work in Cygwin git. :(

If you got something like

  $ git describe
  fatal: cannot describe 'a27cb622b30f18cb8510b7b3856d4029e617d95b'

it means that you don't have any tags in your history.  You should tag your
releases (released versions) using annotated tags.

Anyway you have

  $ git describe --always
  a27cb62

-- 
Jakub Narebski
Poland