Running log -1
once per file irks me so I wrote this to do them all in one pass:
( # don't alter any modified-file stamps:
git diff --name-status --no-find-copies --no-renames | awk '$1="D"' FS=$'\t' OFS=$'\t'
git log --pretty=%cI --first-parent --name-status -m --no-find-copies --no-renames
) | awk ' NF==1 { date=$1 }
NF<2 || seen[$2]++ { next }
$1!="D" { print "touch -d",date,$2 }' FS=$'\t'
which does the linux history in like ten seconds (piping all the touch commands through a shell takes a minute).
This is a good way to ruin e.g. bisecting, and I'm in the camp of ~don't even start down the road of trying to overload filesystem timestamps, the people who insist on doing this are apparently going to have to learn the hard way~, but I can see that maybe there's workflows where this really won't hurt you.
Whatever. But, for sure, do not do this blindly.