git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Stamp Git commit id into file during build process

From
Jakub Narebski <jnareb@gmail.com>
Date
Jan 16, 2010, 21:27 UTC
Message-ID
<201001162227.23236.jnareb@gmail.com>
In-Reply-To
<a1138db31001161312i2c032c38tcc0fb162c61fbb35@mail.gmail.com>
Dnia sobota 16. stycznia 2010 22:12, Paul Richards napisał:
> 2010/1/16 Jakub Narebski <jnareb@gmail.com>:
>> Paul Richards <paul.richards@gmail.com> 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.
Show 5 quoted lines
>> 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
Previous: Shawn O. Pearce
Message 10 of 10 in “Stamp Git commit id into file during build process”
  1. Paul RichardsJan 16, 2010
  2. Erik Faye-LundJan 16, 2010
  3. Erik Faye-LundJan 16, 2010
  4. Sverre RabbelierJan 16, 2010
  5. Erik Faye-LundJan 16, 2010
  6. Sverre RabbelierJan 16, 2010
  7. Jakub NarebskiJan 16, 2010
  8. Paul RichardsJan 16, 2010
  9. Shawn O. PearceJan 16, 2010
  10. Jakub NarebskiJan 16, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.