Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Include git-stash status at command line #969

Closed
wants to merge 1 commit into from

3 participants

@fredw08

Apart from showing git stage/unstage status, a simple stash indicator also useful on managing multiple repo

@Nerian

+1

@robbyrussell

Closing this per #2568.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 24, 2012
  1. Include git-stash status at command line

    fred wong authored
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 1 deletion.
  1. +9 −1 lib/git.zsh
View
10 lib/git.zsh
@@ -1,7 +1,7 @@
# get the name of the branch we are on
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
- echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
+ echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$(parse_git_stash)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
@@ -18,6 +18,14 @@ parse_git_dirty() {
fi
}
+# Checks if working tree contains stash(es)
+parse_git_stash() {
+ if [[ -n $(git stash list 2> /dev/null) ]]; then
+ echo "$ZSH_THEME_GIT_PROMPT_HAVE_STASH"
+ else
+ echo "$ZSH_THEME_GIT_PROMPT_HAVE_NO_STASH"
+ fi
+}
# Checks if there are commits ahead from remote
function git_prompt_ahead() {
Something went wrong with that request. Please try again.