Tor git version is not generated in git worktrees
When I compile tor on macOS, it doesn't log the git version on startup:
Oct 29 01:27:48.261 [notice] Tor 0.3.0.0-alpha-dev running on Darwin with Libevent 2.0.22-stable, OpenSSL 1.0.2j and Zlib 1.2.8.
This happens regardless of compiler and architecture: gcc (MacPorts gcc49 4.9.4_0+universal) 4.9.4 (i386/x86_64) clang version 3.9.0 (tags/RELEASE_390/final) (x86_64)
$ git --version git version 2.10.1
But when I compile it on Linux, I see a git commit hash:
Oct 28 14:28:15.669 [notice] Tor 0.3.0.0-alpha-dev (git-f3e158edf7d8128d) running on Linux with Libevent 2.0.21-stable, OpenSSL 1.0.2g and Zlib 1.2.8.
Compiler: gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
$ git --version git version 2.6.3.36.g9a8c740
I'm putting this in 0.3.0 because it makes diagnosing issues much easier if we have the full commit. But feel free to disagree.