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

Re: How to embed a hash, tag or branch name?

From
Mikko Rapeli <mikko.rapeli@iki.fi>
Date
Jul 31, 2009, 09:52 UTC
Message-ID
<20090731095238.GG29909@nalle>
In-Reply-To
<m3ljm5ryar.fsf@localhost.localdomain>
On Fri, Jul 31, 2009 at 02:27:50AM -0700, Jakub Narebski wrote:
> You can embed SHA-1 of a _file contents_ (blob) using '$Id: $' keyword
> with `ident` attribute - see gitattributes manpage.
Great, thanks!
> The correct solution of embedding version number is to do it at 
> _build time_, using e.g. script similar to GIT-VERSION-GEN used by
> Git itself and by Linux kernel.  It helps if you tag your releases.

This would help, but I'm on cygwin/msysgit and compiling with a microcontroller IDE MPLAB and PICC-18 compiler, so I really don't want to dig deeper into build time integration at the moment.

Btw, I don't know how didn't notice that this is a FAQ: http://git.or.cz/gitwiki/GitFaq#Doesgithavekeywordexpansion.3F

-Mikko
Previous: Jakub NarebskiNext: Dirk Süsserott
Message 3 of 6 in “How to embed a hash, tag or branch name?”
  1. Mikko RapeliJul 31, 2009
  2. Jakub NarebskiJul 31, 2009
  3. Mikko RapeliJul 31, 2009
  4. Dirk SüsserottAug 1, 2009
  5. Jakub NarebskiAug 1, 2009
  6. Dirk SüsserottAug 1, 2009

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.