3a7a5908626c977e9fccaceda3ffeba67c5f1548
- Author
- nyim <nickyim05@gmail.com>
- Committer
- Marc Cornellà <marc.cornella@live.com>
- Date
Message
mortalscumbag add icon showing local branch behind (#4364)
Diff
1diff --git a/themes/mortalscumbag.zsh-theme b/themes/mortalscumbag.zsh-theme
2index 55ece97609c05305695f9dacabf38a77dd0ad63f..8c7b0f5d14fe71dbd98c00e388d5459eb6c04d0a 100644
3--- a/themes/mortalscumbag.zsh-theme
4+++ b/themes/mortalscumbag.zsh-theme
5@@ -9,6 +9,11 @@ function my_git_prompt() {
6 STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
7 fi
8
9+ # is branch behind?
10+ if $(echo "$(git log HEAD..origin/$(current_branch) 2> /dev/null)" | grep '^commit' &> /dev/null); then
11+ STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_BEHIND"
12+ fi
13+
14 # is anything staged?
15 if $(echo "$INDEX" | command grep -E -e '^(D[ M]|[MARC][ MD]) ' &> /dev/null); then
16 STATUS="$STATUS$ZSH_THEME_GIT_PROMPT_STAGED"
17@@ -52,6 +57,7 @@ PROMPT=$'\n$(ssh_connection)%{$fg_bold[green]%}%n@%m%{$reset_color%}$(my_git_pro
18 ZSH_THEME_PROMPT_RETURNCODE_PREFIX="%{$fg_bold[red]%}"
19 ZSH_THEME_GIT_PROMPT_PREFIX=" $fg[white]‹ %{$fg_bold[yellow]%}"
20 ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg_bold[magenta]%}↑"
21+ZSH_THEME_GIT_PROMPT_BEHIND="%{$fg_bold[green]%}↓"
22 ZSH_THEME_GIT_PROMPT_STAGED="%{$fg_bold[green]%}●"
23 ZSH_THEME_GIT_PROMPT_UNSTAGED="%{$fg_bold[red]%}●"
24 ZSH_THEME_GIT_PROMPT_UNTRACKED="%{$fg_bold[white]%}●"