|
|
@ -273,20 +273,23 @@ function git-info() {
|
|
|
|
elif [[ "$branch_info[2]" == (#b)(?##) ]]; then
|
|
|
|
elif [[ "$branch_info[2]" == (#b)(?##) ]]; then
|
|
|
|
branch="$match[1]"
|
|
|
|
branch="$match[1]"
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
|
|
|
|
# Count added, deleted, modified, renamed, unmerged, untracked, dirty.
|
|
|
|
|
|
|
|
# T (type change) is undocumented, see http://git.io/FnpMGw.
|
|
|
|
|
|
|
|
# For a table of scenarii, see http://i.imgur.com/2YLu1.png.
|
|
|
|
|
|
|
|
[[ "$line" == ([ACDMT][\ MT]|[ACMT]D)\ * ]] && (( added++ ))
|
|
|
|
|
|
|
|
[[ "$line" == [\ ACMRT]D\ * ]] && (( deleted++ ))
|
|
|
|
|
|
|
|
[[ "$line" == ?[MT]\ * ]] && (( modified++ ))
|
|
|
|
|
|
|
|
[[ "$line" == R?\ * ]] && (( renamed++ ))
|
|
|
|
|
|
|
|
[[ "$line" == (AA|DD|U?|?U)\ * ]] && (( unmerged++ ))
|
|
|
|
|
|
|
|
[[ "$line" == \?\?\ * ]] && (( untracked++ ))
|
|
|
|
|
|
|
|
(( dirty++ ))
|
|
|
|
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done < <("${(z)status_cmd}" 2>/dev/null)
|
|
|
|
done < <("${(z)status_cmd}" 2>/dev/null)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Get current status.
|
|
|
|
|
|
|
|
while IFS=$'\n' read line; do
|
|
|
|
|
|
|
|
# Count added, deleted, modified, renamed, unmerged, untracked, dirty.
|
|
|
|
|
|
|
|
# T (type change) is undocumented, see http://git.io/FnpMGw.
|
|
|
|
|
|
|
|
# For a table of scenarii, see http://i.imgur.com/2YLu1.png.
|
|
|
|
|
|
|
|
[[ "$line" == ([ACDMT][\ MT]|[ACMT]D)\ * ]] && (( added++ ))
|
|
|
|
|
|
|
|
[[ "$line" == [\ ACMRT]D\ * ]] && (( deleted++ ))
|
|
|
|
|
|
|
|
[[ "$line" == ?[MT]\ * ]] && (( modified++ ))
|
|
|
|
|
|
|
|
[[ "$line" == R?\ * ]] && (( renamed++ ))
|
|
|
|
|
|
|
|
[[ "$line" == (AA|DD|U?|?U)\ * ]] && (( unmerged++ ))
|
|
|
|
|
|
|
|
[[ "$line" == \?\?\ * ]] && (( untracked++ ))
|
|
|
|
|
|
|
|
(( dirty++ ))
|
|
|
|
|
|
|
|
done < <(${(z)status_cmd} 2>/dev/null)
|
|
|
|
|
|
|
|
|
|
|
|
# Format branch.
|
|
|
|
# Format branch.
|
|
|
|
if [[ -n "$branch" ]]; then
|
|
|
|
if [[ -n "$branch" ]]; then
|
|
|
|
zstyle -s ':omz:plugin:git:prompt' branch 'branch_format'
|
|
|
|
zstyle -s ':omz:plugin:git:prompt' branch 'branch_format'
|
|
|
|