File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,9 @@ install: all
1818 cp .version zsh-syntax-highlighting.zsh $(SHARE_DIR )
1919 cp COPYING.md README.md changelog.md $(DOC_DIR )
2020 sed -e ' 1s/ .*//' -e ' /^\[build-status-[a-z]*\]: /d' < README.md > $(DOC_DIR ) /README.md
21- if [ x" true" = x" ` git rev-parse --is-inside-work-tree 2> /dev/null` " ]; then \
22- git rev-parse HEAD; \
23- else \
24- cat .revision-hash; \
25- fi > $(SHARE_DIR ) /.revision-hash
21+ if prefix=` git rev-parse --show-prefix 2> /dev/null` && [ x" $$ prefix" = x ]; then \
22+ git rev-parse HEAD > $(SHARE_DIR ) /.revision-hash; \
23+ fi
2624 :
2725# The [ -e ] check below is to because sh evaluates this with (the moral
2826# equivalent of) NONOMATCH in effect, and highlighters/*.zsh has no matches.
Original file line number Diff line number Diff line change 7373
7474- Recognize ` env ` as a precommand (e.g., ` env FOO=bar ls ` )
7575
76+ - Skip installing .revision-hash if not running ` make install ` from a git checkout.
77+ [ #723 ]
78+
7679# Changes in version 0.7.1
7780
7881- Remove out-of-date information from the 0.7.0 changelog.
Original file line number Diff line number Diff line change @@ -40,12 +40,14 @@ builtin unalias -m '[^+]*'
4040if true ; then
4141 # $0 is reliable
4242 typeset -g ZSH_HIGHLIGHT_VERSION=$( < " ${0: A: h} " /.version)
43- typeset -g ZSH_HIGHLIGHT_REVISION=$( < " ${0: A: h} " /.revision-hash)
44- if [[ $ZSH_HIGHLIGHT_REVISION == \$ Format:* ]]; then
45- # When running from a source tree without 'make install', $ZSH_HIGHLIGHT_REVISION
46- # would be set to '$Format:%H$' literally. That's an invalid value, and obtaining
47- # the valid value (via `git rev-parse HEAD`, as Makefile does) might be costly, so:
48- ZSH_HIGHLIGHT_REVISION=HEAD
43+ if [[ -f " ${0: A: h} " /.revision-hash ]]; then
44+ typeset -g ZSH_HIGHLIGHT_REVISION=$( < " ${0: A: h} " /.revision-hash)
45+ if [[ $ZSH_HIGHLIGHT_REVISION == \$ Format:* ]]; then
46+ # When running from a source tree without 'make install', $ZSH_HIGHLIGHT_REVISION
47+ # would be set to '$Format:%H$' literally. That's an invalid value, and obtaining
48+ # the valid value (via `git rev-parse HEAD`, as Makefile does) might be costly, so:
49+ ZSH_HIGHLIGHT_REVISION=HEAD
50+ fi
4951 fi
5052fi
5153
You can’t perform that action at this time.
0 commit comments