I\'d like to add an automatically generated file to the same commit using a pre- or post-commit hook in Git, dependent on the files that were modified in that commit. How w
You could use a combination of a pre and post commit script.
In the pre-commit:
In the post-commit:
if .commit exists you know a commit has just taken place but a post-commit hasn't run yet. So, you can do your code generation here. Additionally, test for .commit and if it exists:
This is roughly the process I use to store a .metadata file in the repository generated from metastore.
If anyone knows a better way I'm all ears but it seems to work for now.