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

Re: Generate version file by hooks

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Mar 17, 2009, 16:54 UTC
Message-ID
<49BFD5E1.60803@viscovery.net>
In-Reply-To
<200903171740.26575.bjoern01@nurfuerspam.de>
Björn Hendriks schrieb:
> In fact my problem is not to find out the SHA1 of the last commit in a script 
> but to have that script called automatically each time git changes the 
> commit. My idea was to use the git hooks for that, but as I explained I 
> couldn't find hooks for all cases in which a commit changes.

In fact there are so many situations where the current commit changes. You won't find enough hooks to catch all cases.

You better modify your build system to look for the current commit when it is needed. That is *much* safer.

-- Hannes
Previous: Björn Hendriks
Message 3 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.