When using clang as a link in llvm/tools in conjunction with using git repositories running ninja fails with
ninja: error: '/home/.../llvm/.git/modules/external/clang/logs/HEAD', needed by 'tools/clang/lib/Basic/SVNVersion.inc', missing and no known rule to make it
If a .git-file or path is found, we need to determine the real .git-path, which could be anywhere when this repo is a submodule, or ln'd
into tools/.
This patch fixes it by using git rev-parse as llvm/include/llvm/Support/CMakeLists.txt is doing it.
Introduced with https://reviews.llvm.org/D34955
Reading llvm/include/llvm/Support/CMakeLists.txt, I didn't see very much that was borrowed here. I did see similar code in llvm/cmake/modules/VersionFromVCS.cmake, though. Is this a typo? Or maybe I'm misreading?