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

Re: Generate version file by hooks

From
JDJohn Dlugosz <jdlugosz@tradestation.com>
Date
Mar 17, 2009, 15:42 UTC
Message-ID
<450196A1AAAE4B42A00A8B27A59278E70A2AF280@EXCHANGE.trad.tradestation.com>

=== Re: === I'd like to put the SHA1 of the current commit into a source file so that my program can further process it -- put it into a log file for example. === end ===

Isn't that what the existing file HEAD is for?  Possibly with a level of
indirection.  So use 
	git rev-parse HEAD
any time you need that SHA1 value.  The HEAD is always updated, since
that _is_ what defines the "current" commit.

--John (please excuse the footer; it's not my idea)

TradeStation Group, Inc. is a publicly-traded holding company (NASDAQ GS: TRAD) of three operating subsidiaries, TradeStation Securities, Inc. (Member NYSE, FINRA, SIPC and NFA), TradeStation Technologies, Inc., a trading software and subscription company, and TradeStation Europe Limited, a United Kingdom, FSA-authorized introducing brokerage firm. None of these companies provides trading or investment advice, recommendations or endorsements of any kind. The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited.
  If you received this in error, please contact the sender and delete the material from any computer.
Next: Björn Hendriks
Message 1 of 3 in “Re: Generate version file by hooks”
  1. John DlugoszMar 17, 2009
  2. Björn HendriksMar 17, 2009
  3. Johannes SixtMar 17, 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.