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:18 UTC
- Message-ID
- <CACwCsY7o=ArM4T4n7umun-R9Dip5NmmOEL7Ygd9zEQdCyQa4Og@mail.gmail.com>
- In-Reply-To
- <20190205021513.GC527887@genre.crustytoothpaste.net>
On Mon, Feb 4, 2019 at 9:15 PM brian m. carlson <sandals@crustytoothpaste.net> wrote:
Show 15 quoted lines
> > On Mon, Feb 04, 2019 at 09:00:42PM -0500, Larry Martell wrote: > > Thanks for the reply. Any suggestions on how to achieve what I want to do? > > > > The use case is that we want to have a file that is part of the > > install that has certain info (commit id, date of commit, commit > > message, etc.). and we'd like that to be generated automatically. > > 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.