diff options
Diffstat (limited to 'zsh/git.zsh')
-rw-r--r-- | zsh/git.zsh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/zsh/git.zsh b/zsh/git.zsh new file mode 100644 index 0000000..b0ec297 --- /dev/null +++ b/zsh/git.zsh @@ -0,0 +1,19 @@ +#done + +function parse_git_branch { + echo "${ref#refs/heads/}" +} + +function parse_git_staged { + $(git diff-index --quiet --cached HEAD) && return + echo "staged" +} +function parse_git_unstaged { + $(git diff-files --quiet) && return + echo "unstaged" +} + +function git_prompt_info { + ref=$(git symbolic-ref HEAD 2> /dev/null) || return + echo "(${ref#refs/heads/}) " +} |