Our customer insists of having a file history as comments at the top of the file, even though we use git for version control. As a lazy developer (and having serious concerns about the usefulness of in-file histories compared to Version Control systems), I am wondering if I can automate this. Since it is a frequent request, I am wondering if anybody has done this before.
Is it possible to write the commit message automatically to a file, e.g. as a post-commit hook? I've read about git attributes, but they are only expanded when the file is checked out and will not be part of the content of the file in the repository.
I found an example to modify a file in a pre-commit hook, but since I need the commit message, it would have to be done in the post-commit hook. I am not sure if I can amend the commit then.