Simplify Git status indicators in prompt

This commit is contained in:
Andrew Kvalheim 2021-12-09 11:00:34 -08:00
parent af3b7852a1
commit 2308cf0c14

View file

@ -394,9 +394,9 @@
# res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}"
# fi
# ⇣42 if behind the remote.
# ⇣ if behind the remote.
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}"
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
# ⇡ if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
(( VCS_STATUS_COMMITS_AHEAD && !VCS_STATUS_COMMITS_BEHIND )) && res+=" "
(( VCS_STATUS_COMMITS_AHEAD )) && res+="${clean}"
# ⇠42 if behind the push remote.
@ -404,26 +404,26 @@
(( VCS_STATUS_PUSH_COMMITS_AHEAD && !VCS_STATUS_PUSH_COMMITS_BEHIND )) && res+=" "
# ⇢42 if ahead of the push remote; no leading space if also behind: ⇠42⇢42.
(( VCS_STATUS_PUSH_COMMITS_AHEAD )) && res+="${clean}"
# §42 if have stashes.
# § if have stashes.
(( VCS_STATUS_STASHES )) && res+=" ${clean}§"
# 'merge' if the repo is in an unusual state.
[[ -n $VCS_STATUS_ACTION ]] && res+=" ${conflicted}${VCS_STATUS_ACTION}"
# ‼42 if have merge conflicts.
# ‼ if have merge conflicts.
(( VCS_STATUS_NUM_CONFLICTED )) && res+=" ${conflicted}"
# «42 if have staged changes.
(( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}«"
# 42 if have unstaged changes.
(( VCS_STATUS_NUM_UNSTAGED )) && res+=" ${modified}"
# ± if have staged changes.
(( VCS_STATUS_NUM_STAGED )) && res+=" ${modified}±"
# · if have unstaged changes or untracked files.
(( VCS_STATUS_NUM_UNSTAGED || VCS_STATUS_NUM_UNTRACKED )) && res+=" ${modified}·"
# ?42 if have untracked files. It's really a question mark, your font isn't broken.
# See POWERLEVEL9K_VCS_UNTRACKED_ICON above if you want to use a different icon.
# Remove the next line if you don't want to see untracked files at all.
(( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}"
# "" if the number of unstaged files is unknown. This can happen due to
# (( VCS_STATUS_NUM_UNTRACKED )) && res+=" ${untracked}${(g::)POWERLEVEL9K_VCS_UNTRACKED_ICON}"
# "?" if the number of unstaged files is unknown. This can happen due to
# POWERLEVEL9K_VCS_MAX_INDEX_SIZE_DIRTY (see below) being set to a non-negative number lower
# than the number of files in the Git index, or due to bash.showDirtyState being set to false
# in the repository config. The number of staged and untracked files may also be unknown
# in this case.
(( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}"
(( VCS_STATUS_HAS_UNSTAGED == -1 )) && res+=" ${modified}?"
typeset -g my_git_format=$res
}