I would like to create some derived data after doing a pull from GitHub. The repo may have none or many items that need to be built based on what has changed, so I would like to be selective. My first thought was to use a Makefile
and a post-merge
hook, but unless I am totally missing something make
will not work since all the timedate stamps will be meaningless after the pull.
My next thought, based on this answer, is to analyze the results of git diff-tree -r --name-only --no-commit-id HEAD@{1} HEAD
in a post-merge hook and take action based on that analysis.
This seems like something that should come up often but I have not seen recommend idiomatic approach to this. Does anyone know of know of such an approach or have a better recommendation? The answer I am referencing is almost 10 years old
Update
Quentin's comment made me realize the part I was totally missing was that pull does not alter the time / date stamps of files that are not changed. I must have been thinking about after a clone. So I guess make
should work. The times and dates may not match the time and date of the actual file change but will reflect when they were pulled, so I think make
still is an option.