Skip to content

Commit

Permalink
Revert "[Fix ohmyzsh#64] Remove the clean git-info style"
Browse files Browse the repository at this point in the history
This reverts commit a06f13f.

Conflicts:

	modules/git/functions/git-info
	plugins/git/style.zsh
  • Loading branch information
sorin-ionescu committed Apr 15, 2012
1 parent 2859204 commit 73f22c2
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions modules/git/functions/git-info
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,17 @@
# # %b - Branch name.
# zstyle ':omz:module:git' branch 'branch:%b'
#
# # %C - Indicator to notify of a clean working directory.
# zstyle ':omz:module:git' clean 'clean'
#
# # %c - SHA-1 hash.
# zstyle ':omz:module:git' commit 'commit:%c'
#
# # %d - Indicator to notify of deleted files.
# zstyle ':omz:module:git' deleted 'deleted:%d'
#
# # %D - Indicator to notify of dirty files.
# zstyle ':omz:module:git' dirty '%(D.clean.dirty:%D)'
# zstyle ':omz:module:git' dirty 'dirty:%D'
#
# # %m - Indicator to notify of modified files.
# zstyle ':omz:module:git' modified 'modified:%m'
Expand Down Expand Up @@ -57,7 +60,7 @@
#
# # Prompts.
# zstyle ':omz:module:git' info \
# 'prompt' ' git:(%b%D)' \
# 'prompt' ' git:(%b%C%D)' \
# 'rprompt' ''
#

Expand Down Expand Up @@ -186,6 +189,8 @@ function git-info {
local branch_format
local branch_formatted
local branch_info
local clean
local clean_formatted
local commit
local commit_format
local commit_formatted
Expand Down Expand Up @@ -375,9 +380,13 @@ function git-info {
zformat -f untracked_formatted "$untracked_format" "u:$untracked"
fi

# Format dirty.
zstyle -s ':omz:module:git' dirty 'dirty_format'
zformat -f dirty_formatted "$dirty_format" "D:$dirty"
# Format dirty and clean.
if (( $dirty > 0 )); then
zstyle -s ':omz:module:git' dirty 'dirty_format'
zformat -f dirty_formatted "$dirty_format" "D:$dirty"
else
zstyle -s ':omz:module:git' clean 'clean_formatted'
fi

# Format info.
zstyle -a ':omz:module:git' info 'info_formats'
Expand All @@ -391,6 +400,7 @@ function git-info {
"U:$unmerged_formatted" \
"a:$added_formatted" \
"b:$branch_formatted" \
"C:$clean_formatted" \
"c:$commit_formatted" \
"d:$deleted_formatted" \
"m:$modified_formatted" \
Expand Down

0 comments on commit 73f22c2

Please sign in to comment.