[dotmatrix] more on vcs
This commit is contained in:
parent
92509905ab
commit
3e6a09c777
1 changed files with 32 additions and 24 deletions
|
|
@ -599,6 +599,30 @@ __dotmatrix_prompt_vcs() {
|
||||||
|
|
||||||
_lp_smart_mark
|
_lp_smart_mark
|
||||||
|
|
||||||
|
local diffs=
|
||||||
|
if (( LP_ENABLE_VCS_DIFFSTATS )) ; then
|
||||||
|
if [[ "$lp_vcs_commit_ahead" -ne "0" && "$lp_vcs_commit_behind" -ne "0" ]]; then
|
||||||
|
__dotmatrix_make_field "+$lp_vcs_commit_ahead" "${DOTMATRIX_COLOR_NOTE[@]}"
|
||||||
|
has_commit+="${dotmatrix_field}"
|
||||||
|
__dotmatrix_make_sep_soft "${DOTMATRIX_COLOR_NOTE[@]}"
|
||||||
|
has_commit+="${dotmatrix_sep}"
|
||||||
|
__dotmatrix_make_field "-$lp_vcs_commit_behind" "${DOTMATRIX_COLOR_NOTE[@]}"
|
||||||
|
has_commit+="${dotmatrix_field}"
|
||||||
|
|
||||||
|
elif [[ "$lp_vcs_commit_ahead" -ne "0" ]]; then
|
||||||
|
__dotmatrix_make_field "+$lp_vcs_commit_ahead" "${DOTMATRIX_COLOR_NOTE[@]}"
|
||||||
|
has_commit+="${dotmatrix_field}"
|
||||||
|
|
||||||
|
elif [[ "$lp_vcs_commit_behind" -ne "0" ]]; then
|
||||||
|
__dotmatrix_make_field "-$lp_vcs_commit_behind" "${DOTMATRIX_COLOR_NOTE[@]}"
|
||||||
|
has_commit+="${dotmatrix_field}"
|
||||||
|
fi
|
||||||
|
diffs+="${has_commit}"
|
||||||
|
else
|
||||||
|
__dotmatrix_make_field "${DOTMATRIX_DIFF}" "${DOTMATRIX_COLOR_LITE[@]}"
|
||||||
|
diffs+="${dotmatrix_field}"
|
||||||
|
fi # LP_ENABLE_VCS_DIFFSTATS
|
||||||
|
|
||||||
# Mark & commits off remote
|
# Mark & commits off remote
|
||||||
local has_commit=
|
local has_commit=
|
||||||
if _lp_vcs_commits_off_remote; then
|
if _lp_vcs_commits_off_remote; then
|
||||||
|
|
@ -608,31 +632,15 @@ __dotmatrix_prompt_vcs() {
|
||||||
__dotmatrix_make_sep_link "${DOTMATRIX_COLOR_NOTE[@]}"
|
__dotmatrix_make_sep_link "${DOTMATRIX_COLOR_NOTE[@]}"
|
||||||
_DOTMATRIX_VCS+="${dotmatrix_sep}"
|
_DOTMATRIX_VCS+="${dotmatrix_sep}"
|
||||||
|
|
||||||
if (( LP_ENABLE_VCS_DIFFSTATS )) ; then
|
_DOTMATRIX_VCS+="${diffs}"
|
||||||
if [[ "$lp_vcs_commit_ahead" -ne "0" && "$lp_vcs_commit_behind" -ne "0" ]]; then
|
|
||||||
__dotmatrix_make_field "+$lp_vcs_commit_ahead" "${DOTMATRIX_COLOR_NOTE[@]}"
|
|
||||||
has_commit+="${dotmatrix_field}"
|
|
||||||
__dotmatrix_make_sep_soft "${DOTMATRIX_COLOR_NOTE[@]}"
|
|
||||||
has_commit+="${dotmatrix_sep}"
|
|
||||||
__dotmatrix_make_field "-$lp_vcs_commit_behind" "${DOTMATRIX_COLOR_NOTE[@]}"
|
|
||||||
has_commit+="${dotmatrix_field}"
|
|
||||||
|
|
||||||
elif [[ "$lp_vcs_commit_ahead" -ne "0" ]]; then
|
if [[ "$lp_vcs_commit_ahead" -ne "0" && "$lp_vcs_commit_behind" -ne "0" ]]; then
|
||||||
__dotmatrix_make_field "+$lp_vcs_commit_ahead" "${DOTMATRIX_COLOR_NOTE[@]}"
|
__dotmatrix_make_sep_plug "${DOTMATRIX_COLOR_NOTE[@]}"
|
||||||
has_commit+="${dotmatrix_field}"
|
_DOTMATRIX_VCS+="${dotmatrix_sep}"
|
||||||
|
|
||||||
elif [[ "$lp_vcs_commit_behind" -ne "0" ]]; then
|
|
||||||
__dotmatrix_make_field "-$lp_vcs_commit_behind" "${DOTMATRIX_COLOR_NOTE[@]}"
|
|
||||||
has_commit+="${dotmatrix_field}"
|
|
||||||
fi
|
|
||||||
_DOTMATRIX_VCS+="${has_commit}"
|
|
||||||
else
|
else
|
||||||
__dotmatrix_make_field "${DOTMATRIX_DIFF}" "${DOTMATRIX_COLOR_NOTE[@]}"
|
__dotmatrix_make_sep_plug "${DOTMATRIX_COLOR_LITE[@]}"
|
||||||
_DOTMATRIX_VCS+="${dotmatrix_field}"
|
_DOTMATRIX_VCS+="${dotmatrix_sep}"
|
||||||
fi # LP_ENABLE_VCS_DIFFSTATS
|
fi
|
||||||
|
|
||||||
__dotmatrix_make_sep_plug "${DOTMATRIX_COLOR_LITE[@]}"
|
|
||||||
_DOTMATRIX_VCS+="${dotmatrix_sep}"
|
|
||||||
|
|
||||||
else # No commit off remote
|
else # No commit off remote
|
||||||
__dotmatrix_make_field "${DOTMATRIX_VCS}${lp_smart_mark}" "${DOTMATRIX_COLOR_DARK[@]}"
|
__dotmatrix_make_field "${DOTMATRIX_VCS}${lp_smart_mark}" "${DOTMATRIX_COLOR_DARK[@]}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue