File tree 3 files changed +14
-11
lines changed
3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -18,11 +18,9 @@ install: all
18
18
cp .version zsh-syntax-highlighting.zsh $(SHARE_DIR )
19
19
cp COPYING.md README.md changelog.md $(DOC_DIR )
20
20
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
26
24
:
27
25
# The [ -e ] check below is to because sh evaluates this with (the moral
28
26
# equivalent of) NONOMATCH in effect, and highlighters/*.zsh has no matches.
Original file line number Diff line number Diff line change 73
73
74
74
- Recognize ` env ` as a precommand (e.g., ` env FOO=bar ls ` )
75
75
76
+ - Skip installing .revision-hash if not running ` make install ` from a git checkout.
77
+ [ #723 ]
78
+
76
79
# Changes in version 0.7.1
77
80
78
81
- 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 '[^+]*'
40
40
if true ; then
41
41
# $0 is reliable
42
42
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
49
51
fi
50
52
fi
51
53
You can’t perform that action at this time.
0 commit comments