Skip to content

Commit

Permalink
mortalscumbag add icon showing local branch behind (ohmyzsh#4364)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyim authored and Brian Kan committed Jan 8, 2020
1 parent 1ada154 commit c7e93ee
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions themes/mortalscumbag.zsh-theme
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ function my_git_prompt() {
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
fi

# is branch behind?
if $(echo "$(git log HEAD..origin/$(current_branch) 2> /dev/null)" | grep '^commit' &> /dev/null); then
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_BEHIND"
fi

# is anything staged?
if $(echo "$INDEX" | command grep -E -e '^(D[ M]|[MARC][ MD]) ' &> /dev/null); then
STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_STAGED"
Expand Down Expand Up @@ -52,6 +57,7 @@ PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}$(my_git_pro
ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}"
ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}"
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[magenta]%}↑"
ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg_bold[green]%}↓"
ZSH_THEME_GIT_PROMPT_STAGED="%{$fg_bold[green]%}●"
ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg_bold[red]%}●"
ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[white]%}●"
Expand Down

0 comments on commit c7e93ee

Please sign in to comment.