I have seen this answer and it is almost exactly what I need.
Difference is that will print date for human eyes, while I need to check it in a Makefile.
In particular I need to rebuild a certain file IFF something changed in repo after its creation.
I might not have a local copy of repo, so I might need a full "git clone" (possibly shallow), but I cannot directly use file dates because git does not preserve them.
I need something like:
if myfile is_older $(git log -1 --format=%cd origin/master); then ...
or, in Makefile
:
myfile: $(somefunc $(shell git log -1 --format=%cd origin/master))
commands to rebuild myfile
but I don't know how to write it.