summaryrefslogtreecommitdiff
path: root/gitstatus
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-03-14 22:46:46 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-03-14 22:46:46 +0300
commitf7a2a26cec4debe0739c37468852ebbc3dd6c248 (patch)
tree14648b8247fd617337bcaa381e22c4453d59f152 /gitstatus
parent7097aca6d3da58f6cc7e26ad8c01f6f34867ef96 (diff)
pull upstream
Diffstat (limited to 'gitstatus')
-rwxr-xr-xgitstatus/bin/gitstatusd-darwin-x86_64bin958724 -> 965472 bytes
-rwxr-xr-xgitstatus/bin/gitstatusd-freebsd-amd64bin2883216 -> 2887312 bytes
-rwxr-xr-xgitstatus/bin/gitstatusd-linux-armv7lbin1697276 -> 1709580 bytes
-rwxr-xr-xgitstatus/bin/gitstatusd-linux-x86_64bin2102536 -> 2118928 bytes
-rw-r--r--gitstatus/gitstatus.plugin.zsh35
5 files changed, 21 insertions, 14 deletions
diff --git a/gitstatus/bin/gitstatusd-darwin-x86_64 b/gitstatus/bin/gitstatusd-darwin-x86_64
index 55a30723..e3f446ba 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 6e4483f6..59645e82 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 6cac661d..fbbf5f5b 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 a107c9d4..8e0a4658 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 b55aa1d6..ba48a99b 100644
--- a/gitstatus/gitstatus.plugin.zsh
+++ b/gitstatus/gitstatus.plugin.zsh
@@ -24,7 +24,9 @@ zmodload zsh/datetime || return
#
# If VCS_STATUS_RESULT is ok-sync or ok-async, additional variables are set:
#
-# VCS_STATUS_LOCAL_BRANCH Local branch name. Not empty.
+# VCS_STATUS_WORKDIR Git repo working directory. Not empty.
+# VCS_STATUS_COMMIT Commit hash that HEAD is pointing to. 40 hex digits.
+# VCS_STATUS_LOCAL_BRANCH Local branch name or empty if not on a branch.
# VCS_STATUS_REMOTE_BRANCH Upstream branch name. Can be empty.
# VCS_STATUS_REMOTE_URL Remote URL. Can be empty.
# VCS_STATUS_ACTION Repository state, A.K.A. action. Can be empty.
@@ -36,7 +38,8 @@ zmodload zsh/datetime || return
# VCS_STATUS_COMMITS_BEHIND Number of commits the current branch is behind upstream. Non-negative
# integer.
# VCS_STATUS_STASHES Number of stashes. Non-negative integer.
-# VCS_STATUS_WORKDIR Git repo working directory. Not empty.
+# VCS_STATUS_TAG The first tag (in lexicographical order) that points to the same
+# commit as HEAD.
# VCS_STATUS_ALL All of the above in an array. The order of elements is unspecified.
# More elements can be added in the future.
#
@@ -129,20 +132,24 @@ typeset -fH _gitstatus_process_response() {
[[ ${VCS_STATUS_ALL[2]} == 1 ]] && {
shift 2 VCS_STATUS_ALL
(( ours )) && VCS_STATUS_RESULT=ok-sync || VCS_STATUS_RESULT=ok-async
- typeset -g VCS_STATUS_LOCAL_BRANCH="${VCS_STATUS_ALL[1]}"
- typeset -g VCS_STATUS_REMOTE_BRANCH="${VCS_STATUS_ALL[2]}"
- typeset -g VCS_STATUS_REMOTE_URL="${VCS_STATUS_ALL[3]}"
- typeset -g VCS_STATUS_ACTION="${VCS_STATUS_ALL[4]}"
- typeset -gi VCS_STATUS_HAS_STAGED="${VCS_STATUS_ALL[5]}"
- typeset -gi VCS_STATUS_HAS_UNSTAGED="${VCS_STATUS_ALL[6]}"
- typeset -gi VCS_STATUS_HAS_UNTRACKED="${VCS_STATUS_ALL[7]}"
- typeset -gi VCS_STATUS_COMMITS_AHEAD="${VCS_STATUS_ALL[8]}"
- typeset -gi VCS_STATUS_COMMITS_BEHIND="${VCS_STATUS_ALL[9]}"
- typeset -gi VCS_STATUS_STASHES="${VCS_STATUS_ALL[10]}"
- typeset -g VCS_STATUS_WORKDIR="${VCS_STATUS_ALL[11]}"
+ typeset -g VCS_STATUS_WORKDIR="${VCS_STATUS_ALL[1]}"
+ typeset -g VCS_STATUS_COMMIT="${VCS_STATUS_ALL[2]}"
+ typeset -g VCS_STATUS_LOCAL_BRANCH="${VCS_STATUS_ALL[3]}"
+ typeset -g VCS_STATUS_REMOTE_BRANCH="${VCS_STATUS_ALL[4]}"
+ typeset -g VCS_STATUS_REMOTE_URL="${VCS_STATUS_ALL[5]}"
+ typeset -g VCS_STATUS_ACTION="${VCS_STATUS_ALL[6]}"
+ typeset -gi VCS_STATUS_HAS_STAGED="${VCS_STATUS_ALL[7]}"
+ typeset -gi VCS_STATUS_HAS_UNSTAGED="${VCS_STATUS_ALL[8]}"
+ typeset -gi VCS_STATUS_HAS_UNTRACKED="${VCS_STATUS_ALL[9]}"
+ typeset -gi VCS_STATUS_COMMITS_AHEAD="${VCS_STATUS_ALL[10]}"
+ typeset -gi VCS_STATUS_COMMITS_BEHIND="${VCS_STATUS_ALL[11]}"
+ typeset -gi VCS_STATUS_STASHES="${VCS_STATUS_ALL[12]}"
+ typeset -g VCS_STATUS_TAG="${VCS_STATUS_ALL[13]}"
} || {
(( ours )) && VCS_STATUS_RESULT=norepo-sync || VCS_STATUS_RESULT=norepo-async
unset VCS_STATUS_ALL
+ unset VCS_STATUS_WORKDIR
+ unset VCS_STATUS_COMMIT
unset VCS_STATUS_LOCAL_BRANCH
unset VCS_STATUS_REMOTE_BRANCH
unset VCS_STATUS_REMOTE_URL
@@ -153,7 +160,7 @@ typeset -fH _gitstatus_process_response() {
unset VCS_STATUS_COMMITS_AHEAD
unset VCS_STATUS_COMMITS_BEHIND
unset VCS_STATUS_STASHES
- unset VCS_STATUS_WORKDIR
+ unset VCS_STATUS_TAG
}
(( ! ours )) && (( #header )) && emulate -L zsh && "${header[@]}" || true