misc/zshrc_vcsinfo
changeset 54 c8054d1073d3
parent 23 c215dcd869ce
equal deleted inserted replaced
53:4767c5a8b1f9 54:c8054d1073d3
   109 		git status --porcelain | grep '??' &> /dev/null ; then
   109 		git status --porcelain | grep '??' &> /dev/null ; then
   110 		# This will show the marker if there are any untracked files in repo.
   110 		# This will show the marker if there are any untracked files in repo.
   111 		# If instead you want to show the marker only if there are untracked
   111 		# If instead you want to show the marker only if there are untracked
   112 		# files in $PWD, use:
   112 		# files in $PWD, use:
   113 		#[[ -n $(git ls-files --others --exclude-standard) ]] ; then
   113 		#[[ -n $(git ls-files --others --exclude-standard) ]] ; then
   114 		local nb_untracked=$(git status --porcelain | grep "\? \?" | wc -l)
   114 		local nb_untracked=$(git status --porcelain | grep "? ?" | wc -l)
   115 		local nb_up=$(git status --porcelain | grep "M" | wc -l)
   115 		local nb_up=$(git status --porcelain | grep "M" | wc -l)
   116 		hook_com[staged]+="%{${reset_color}%}$nb_untracked%{$fg[red]%}N %{${reset_color}%}$nb_up"
   116 		hook_com[staged]+="%{${reset_color}%}$nb_untracked%{$fg[red]%}N %{${reset_color}%}$nb_up"
   117 	fi
   117 	fi
   118 }
   118 }
   119 
   119