Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'tracked' context to git-info #1664

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions modules/git/functions/git-info
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,9 @@ function git-info {
local dirty=0
local dirty_format
local dirty_formatted
local tracked=0
local tracked_format
local tracked_formatted
local ignore_submodules
local indexed=0
local indexed_format
Expand Down Expand Up @@ -403,6 +406,13 @@ function git-info {
fi
fi

# Format tracked.
(( tracked = dirty - untracked ))
if (( tracked > 0 )); then
zstyle -s ':prezto:module:git:info:tracked' format 'tracked_format'
zformat -f tracked_formatted "$tracked_format" "t:$tracked"
fi

# Format dirty and clean.
if (( dirty > 0 )); then
zstyle -s ':prezto:module:git:info:dirty' format 'dirty_format'
Expand Down Expand Up @@ -432,6 +442,7 @@ function git-info {
"s:$action_formatted" \
"S:$stashed_formatted" \
"U:$unmerged_formatted" \
"t:$tracked_formatted" \
"u:$untracked_formatted"
git_info[$info_format]="$REPLY"
done
Expand Down