There are a few answers about getting the most recent commit for a file. The answers boil down to "git log --all --pretty=format:%H -- path."
Note the --all to search the whole graph.
git log is very slow. It seems to take a few seconds per operation which is painful when you've got thousands of files to look at. Is there a faster plumbing way to do this?
-n 1option to limit to 1 commit, since you only want the most recent. Don't know if it will speed up but it's worth a try. Also, if you are on windows, there are other reasons git could be slow in general