[PATCH] Add support for git svn to get the repo version in clang executable

I recently checked out the repo using git-svn, and I noticed when I built clang that the word “trunk” was missing from the version info.

This is what was showing up…

clang version 2.8 ($URL$ 110106) # because it is not taking the value from svn
Target: i386-apple-darwin10
Thread model: posix

Instead of…

clang version 2.8 (trunk 110106)
Target: i386-apple-darwin10
Thread model: posix

So, I went on IRC and Daniel thought that it might be a good idea to do it like it is done with the revision number, so here is my take on it.

GetRepositoryPath goes in llvms’ utils folder, and the rest of the patch is for clang.

One thing to note is that I did this only for the Makefile and not for cmake, so that may cause issues. Either way, let me know what you think, and if you want me to change anything.


GetRepositoryPath (636 Bytes)

git_repo_path.patch (1.94 KB)

I forgot to add checks to see if the path was empty, here is the updated patch.


git_repo_path.patch (3.16 KB)