[tor-bugs] #20492 [Core Tor/Tor]: Tor git version displayed on Linux, but not macOS

Tor Bug Tracker & Wiki blackhole at torproject.org
Sat Dec 3 07:34:14 UTC 2016


#20492: Tor git version displayed on Linux, but not macOS
--------------------------+------------------------------
 Reporter:  teor          |          Owner:
     Type:  defect        |         Status:  new
 Priority:  Medium        |      Milestone:  Tor: 0.3.???
Component:  Core Tor/Tor  |        Version:
 Severity:  Normal        |     Resolution:
 Keywords:  log, easy     |  Actual Points:
Parent ID:                |         Points:  0.5
 Reviewer:                |        Sponsor:
--------------------------+------------------------------

Comment (by teor):

 Interesting.

 It looks like the micro-revision.i make script is incompatible with using
 git worktrees.

 In my base git directory, I see:
 {{{
 $ src/or/tor --version
 Tor version 0.2.9.4-alpha-dev (git-ff3e08f2af226d96).
 $ cat micro-revision.i
 "ff3e08f2af226d96"
 $ ls -ld .git
 drwxr-xr-x  22 username  staff  748  3 Dec 08:55 .git
 }}}

 In a worktree, I see:
 {{{
 $ src/or/tor --version
 Tor version 0.3.0.0-alpha-dev.
 $ cat micro-revision.i
 ""
 $ ls -ld .git
 -rw-r--r--  1 username  staff  58 26 Nov  2015 .git
 }}}

 The script to create micro-revision.i is in the Makefile:
 {{{
 micro-revision.i: FORCE
         $(AM_V_at)rm -f micro-revision.tmp; \
         if test -d "$(top_srcdir)/.git" && \
                         test -x "`which git 2>&1;true`"; then \
                 HASH="`cd "$(top_srcdir)" && git rev-parse --short=16
 HEAD`"; \
                 echo \"$$HASH\" > micro-revision.tmp; \
         fi; \
         if test ! -f micro-revision.tmp; then \
                 if test ! -f micro-revision.i; then \
                         echo '""' > micro-revision.i; \
                 fi; \
         elif test ! -f micro-revision.i || \
                         test x"`cat micro-revision.tmp`" != x"`cat micro-
 revision.i`"; then \
                 mv micro-revision.tmp micro-revision.i; \
         fi; \
         rm -f micro-revision.tmp; \
         true
 }}}

 The initial test needs to check if the .git file or directory exists, not
 that it's a directory. (It could be a symlink, for example.)

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/20492#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list