git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Stamp Git commit id into file during build process
@ 2010-01-16 18:50 Paul Richards
  2010-01-16 19:14 ` Erik Faye-Lund
  2010-01-16 19:35 ` Jakub Narebski
  0 siblings, 2 replies; 10+ messages in thread
From: Paul Richards @ 2010-01-16 18:50 UTC (permalink / raw)
  To: git

Hi,
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.

With subversion I used the SubWCRev tool from TortoiseSVN
(http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-subwcrev.html).

With Git I imagine that I'd like to put a copy of the current commit
id (either the full hash or a truncated version of that) into a file
which then gets included into the program source code in some way.

Is there a recommended way of doing this with git?  Perhaps with
something similar to SubWCRev?

Currently I am thinking about using "git log", and grepping the output
in some way so that I just get the hash.

Thanks in advance,


-- 
Paul Richards

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-01-16 21:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-16 18:50 Stamp Git commit id into file during build process Paul Richards
2010-01-16 19:14 ` Erik Faye-Lund
2010-01-16 19:15   ` Erik Faye-Lund
2010-01-16 19:17   ` Sverre Rabbelier
2010-01-16 19:22     ` Erik Faye-Lund
2010-01-16 19:29       ` Sverre Rabbelier
2010-01-16 19:35 ` Jakub Narebski
2010-01-16 21:12   ` Paul Richards
2010-01-16 21:26     ` Shawn O. Pearce
2010-01-16 21:27     ` Jakub Narebski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).