Skip to content

Instantly share code, notes, and snippets.

@munshkr
Created March 21, 2013 14:57
Show Gist options
  • Save munshkr/5213694 to your computer and use it in GitHub Desktop.
Save munshkr/5213694 to your computer and use it in GitHub Desktop.
Extension for [git-aware-prompt](https://github.com/jimeh/git-aware-prompt). Shows an "{S}" on the prompt to alert you of a non-empty stash.
source $DOTBASH/colors.sh
source $DOTBASH/prompt.sh
source $DOTBASH/stash.sh
function is_stash_empty {
local dir=. head
until [ "$dir" -ef / ]; do
if [ -f "$dir/.git/refs/stash" ]; then
stash_state='{S}'
return
fi
dir="../$dir"
done
stash_state=''
}
PROMPT_COMMAND="is_stash_empty; $PROMPT_COMMAND"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment