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

hook to get info on commit, and include that in a file that is part of the commit

From
Larry Martell <larry.martell@gmail.com>
Date
Feb 5, 2019, 01:36 UTC
Message-ID
<CACwCsY5xU0pUaPZDJMqWNB0dz7DjTx3_b2Lvrft0NjA6cnPvcg@mail.gmail.com>

Is there any way using a git hook to get info on the commit (id, message), put that in a file, and include that file in the commit?

If I try that in a pre-commit hook I do not get the info on the current commit. I tried it in pre-receive but it does not seem to get executed at all.

If I do it in post-receive it's too late to check the file in with the commit.
Os there no way to do this?
Next: brian m. carlson
Message 1 of 7 in “hook to get info on commit, and include that in a file that is part of the commit”
  1. Larry MartellFeb 5, 2019
  2. brian m. carlsonFeb 5, 2019
  3. Larry MartellFeb 5, 2019
  4. brian m. carlsonFeb 5, 2019
  5. Larry MartellFeb 5, 2019
  6. brian m. carlsonFeb 5, 2019
  7. Larry MartellFeb 5, 2019

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.