dotfiles/fish/functions/git_dirty_files_count.fish

8 lines
276 B
Fish
Raw Normal View History

2009-06-10 13:04:31 +10:00
function git_dirty_files_count
if test -d .git
git diff --stat | tail -n1 | sed -E 's/^ *//' | sed -E 's/ [a-z ]+\((.)(\),)?/\1/g' | sed -E 's/[a-z ]+, / (/' | sed -E "s/([0-9]+)\+/$pr_green\1$pr_grey+/g" | sed -E "s/([0-9]+)\-/$pr_red\1$pr_grey-/g"
end
end