aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-03-11 15:19:29 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-03-11 15:19:29 +0300
commit4089350dbfe6de5ccbdf1cf2c845d874bd87fa41 (patch)
treef6a5f059340057e9c75647770f307d6e3ff3bbc5
parent0061264f57735fc34f9f0f4d7a07f805ff7e8087 (diff)
pull upstream changes from gitstatus
-rwxr-xr-xgitstatus/bin/gitstatusd-darwin-x86_64bin972936 -> 958724 bytes
-rwxr-xr-xgitstatus/bin/gitstatusd-freebsd-amd64bin2761384 -> 2883216 bytes
-rwxr-xr-xgitstatus/bin/gitstatusd-linux-armv7lbin1656256 -> 1697276 bytes
-rwxr-xr-xgitstatus/bin/gitstatusd-linux-x86_64bin2094344 -> 2102536 bytes
-rw-r--r--gitstatus/gitstatus.plugin.zsh19
5 files changed, 12 insertions, 7 deletions
diff --git a/gitstatus/bin/gitstatusd-darwin-x86_64 b/gitstatus/bin/gitstatusd-darwin-x86_64
index c0555111..e8af4d00 100755
--- a/gitstatus/bin/gitstatusd-darwin-x86_64
+++ b/gitstatus/bin/gitstatusd-darwin-x86_64
Binary files differ
diff --git a/gitstatus/bin/gitstatusd-freebsd-amd64 b/gitstatus/bin/gitstatusd-freebsd-amd64
index 26152b36..440a6549 100755
--- a/gitstatus/bin/gitstatusd-freebsd-amd64
+++ b/gitstatus/bin/gitstatusd-freebsd-amd64
Binary files differ
diff --git a/gitstatus/bin/gitstatusd-linux-armv7l b/gitstatus/bin/gitstatusd-linux-armv7l
index 95187591..84659464 100755
--- a/gitstatus/bin/gitstatusd-linux-armv7l
+++ b/gitstatus/bin/gitstatusd-linux-armv7l
Binary files differ
diff --git a/gitstatus/bin/gitstatusd-linux-x86_64 b/gitstatus/bin/gitstatusd-linux-x86_64
index 2b02cd76..c060296c 100755
--- a/gitstatus/bin/gitstatusd-linux-x86_64
+++ b/gitstatus/bin/gitstatusd-linux-x86_64
Binary files differ
diff --git a/gitstatus/gitstatus.plugin.zsh b/gitstatus/gitstatus.plugin.zsh
index 3f971139..b55aa1d6 100644
--- a/gitstatus/gitstatus.plugin.zsh
+++ b/gitstatus/gitstatus.plugin.zsh
@@ -189,13 +189,10 @@ function gitstatus_start() {
[[ ! -v GITSTATUS_DAEMON_PID_${name} ]] || return 0
- function gitstatus_arch() {
- local kernel && kernel=$(uname -s) && [[ -n $kernel ]]
- local arch && arch=$(uname -m) && [[ -n $arch ]]
- echo -E "${kernel:l}-${arch:l}"
- }
+ local os && os=$(uname -s) && [[ -n $os ]]
+ local arch && arch=$(uname -m) && [[ -n $arch ]]
- local daemon && daemon=${GITSTATUS_DAEMON:-${${(%):-%x}:A:h}/bin/gitstatusd-$(gitstatus_arch)}
+ local daemon && daemon=${GITSTATUS_DAEMON:-${${(%):-%x}:A:h}/bin/gitstatusd-${os:l}-${arch:l}}
[[ -f $daemon ]] || { echo "file not found: $daemon" >&2 && return 1 }
local req_fifo resp_fifo log
@@ -217,9 +214,17 @@ function gitstatus_start() {
log=$(mktemp "${TMPDIR:-/tmp}"/gitstatus.$$.log.XXXXXXXXXX) ||
log=/dev/null
+ local -i threads=${GITSTATUS_NUM_THREADS:-0}
+ (( threads > 0)) || {
+ case $os in
+ FreeBSD) threads=$(sysctl -n hw.ncpu);;
+ *) threads=$(getconf _NPROCESSORS_ONLN);;
+ esac
+ }
+
# We use `zsh -c` instead of plain {} or () to work around bugs in zplug. It hangs on startup.
zsh -c "
- ${(q)daemon} --dirty-max-index-size=${(q)max_dirty} --parent-pid=$$
+ ${(q)daemon} --parent-pid=$$ --dirty-max-index-size=${(q)max_dirty} --num-threads=$threads
echo -nE $'bye\x1f0\x1e'
rm -f ${(q)req_fifo} ${(q)resp_fifo}
" <&$req_fd >&$resp_fd 2>$log &!