We are now using only CMake to generate `GitRef.hpp`. This should make it easier to build on Windows.
We use git's pretty formatting instead of rev-parse to output the full file in a single command, then CMake's `copy_if_different` to avoid unnecessary rebuilds.
Trick is to use %n for newlines and %x22 for quotes. See https://git-scm.com/docs/pretty-formats
We also output "unknown" and a warning when git is not available.