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

Re: 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, 02:42 UTC
Message-ID
<CACwCsY4tAZm4+R+jxkuSyJUEz8ZTt4_CMW-OU0TRBPpFXp=vJw@mail.gmail.com>
In-Reply-To
<20190205024055.GD527887@genre.crustytoothpaste.net>

On Mon, Feb 4, 2019 at 9:41 PM brian m. carlson <sandals@crustytoothpaste.net> wrote:

Show 20 quoted lines
>
> On Mon, Feb 04, 2019 at 09:18:14PM -0500, Larry Martell wrote:
> > On Mon, Feb 4, 2019 at 9:15 PM brian m. carlson
> > <sandals@crustytoothpaste.net> wrote:
> > > If you want to generate a file, you can certainly do that in the
> > > post-commit hook or using a Makefile target. You just can't check it
> > > into the repo. Lots of projects do this as part of their build process.
> > >
> > > An example of what you could do is "git log --pretty='tformat:%H%n%B' HEAD".
> > > That will print the commit hash and commit message to standard output
> > > for each commit. If you want just one commit, you can use "-1".
> >
> > Yeah, but I want it part of the repo so it makes it to the target system.
>
> You can create an additional commit for each commit that you put in with
> the additional file, or you can serialize it as a note for the commit
> (using git notes), which can then be pushed to the remote server by
> pushing refs/notes/commits.
>
> I'm not aware of any other way to do what you want.
Thanks. That is what I will end up doing.
Previous: brian m. carlson
Message 7 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.