Skip installing .revision-hash if not running make install
from a git checkout
Check --show-prefix rather than --is-inside-work-tree in case we're inside some other git repository (e.g. a ports tree).
This commit is contained in:
parent
415e762ab2
commit
2160c2d114
8
Makefile
8
Makefile
@ -18,11 +18,9 @@ install: all
|
|||||||
cp .version zsh-syntax-highlighting.zsh $(SHARE_DIR)
|
cp .version zsh-syntax-highlighting.zsh $(SHARE_DIR)
|
||||||
cp COPYING.md README.md changelog.md $(DOC_DIR)
|
cp COPYING.md README.md changelog.md $(DOC_DIR)
|
||||||
sed -e '1s/ .*//' -e '/^\[build-status-[a-z]*\]: /d' < README.md > $(DOC_DIR)/README.md
|
sed -e '1s/ .*//' -e '/^\[build-status-[a-z]*\]: /d' < README.md > $(DOC_DIR)/README.md
|
||||||
if [ x"true" = x"`git rev-parse --is-inside-work-tree 2>/dev/null`" ]; then \
|
if prefix=`git rev-parse --show-prefix 2>/dev/null` && [ x"$$prefix" = x ]; then \
|
||||||
git rev-parse HEAD; \
|
git rev-parse HEAD > $(SHARE_DIR)/.revision-hash; \
|
||||||
else \
|
fi
|
||||||
cat .revision-hash; \
|
|
||||||
fi > $(SHARE_DIR)/.revision-hash
|
|
||||||
:
|
:
|
||||||
# The [ -e ] check below is to because sh evaluates this with (the moral
|
# The [ -e ] check below is to because sh evaluates this with (the moral
|
||||||
# equivalent of) NONOMATCH in effect, and highlighters/*.zsh has no matches.
|
# equivalent of) NONOMATCH in effect, and highlighters/*.zsh has no matches.
|
||||||
|
@ -73,6 +73,9 @@
|
|||||||
|
|
||||||
- Recognize `env` as a precommand (e.g., `env FOO=bar ls`)
|
- Recognize `env` as a precommand (e.g., `env FOO=bar ls`)
|
||||||
|
|
||||||
|
- Skip installing .revision-hash if not running `make install` from a git checkout.
|
||||||
|
[#723]
|
||||||
|
|
||||||
# Changes in version 0.7.1
|
# Changes in version 0.7.1
|
||||||
|
|
||||||
- Remove out-of-date information from the 0.7.0 changelog.
|
- Remove out-of-date information from the 0.7.0 changelog.
|
||||||
|
@ -40,12 +40,14 @@ builtin unalias -m '[^+]*'
|
|||||||
if true; then
|
if true; then
|
||||||
# $0 is reliable
|
# $0 is reliable
|
||||||
typeset -g ZSH_HIGHLIGHT_VERSION=$(<"${0:A:h}"/.version)
|
typeset -g ZSH_HIGHLIGHT_VERSION=$(<"${0:A:h}"/.version)
|
||||||
typeset -g ZSH_HIGHLIGHT_REVISION=$(<"${0:A:h}"/.revision-hash)
|
if [[ -f "${0:A:h}"/.revision-hash ]]; then
|
||||||
if [[ $ZSH_HIGHLIGHT_REVISION == \$Format:* ]]; then
|
typeset -g ZSH_HIGHLIGHT_REVISION=$(<"${0:A:h}"/.revision-hash)
|
||||||
# When running from a source tree without 'make install', $ZSH_HIGHLIGHT_REVISION
|
if [[ $ZSH_HIGHLIGHT_REVISION == \$Format:* ]]; then
|
||||||
# would be set to '$Format:%H$' literally. That's an invalid value, and obtaining
|
# When running from a source tree without 'make install', $ZSH_HIGHLIGHT_REVISION
|
||||||
# the valid value (via `git rev-parse HEAD`, as Makefile does) might be costly, so:
|
# would be set to '$Format:%H$' literally. That's an invalid value, and obtaining
|
||||||
ZSH_HIGHLIGHT_REVISION=HEAD
|
# the valid value (via `git rev-parse HEAD`, as Makefile does) might be costly, so:
|
||||||
|
ZSH_HIGHLIGHT_REVISION=HEAD
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user