From: Mikko Rapeli Date: Fri, 31 Jul 2009 09:52:38 GMT Subject: Re: How to embed a hash, tag or branch name? Message-ID: <20090731095238.GG29909@nalle> In-Reply-To: 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