Skip to content

Instantly share code, notes, and snippets.

@bas080
Created November 9, 2018 07:31
Show Gist options
  • Save bas080/b26e28affb56c8acf668e0d6c7be80ed to your computer and use it in GitHub Desktop.
Save bas080/b26e28affb56c8acf668e0d6c7be80ed to your computer and use it in GitHub Desktop.
#!/bin/bash
export PS1='$(jobs-count)$(__git_ps1 | sed "s/ //g")$(git-unpushed)$(basename "$PWD") '
git-unpushed() {
local n="$(git log --oneline "@{u}.." 2> /dev/null | wc -l)"
test "$n" -gt 0 && echo "{$n}"
}
jobs-count() {
local n=$(jobs | wc -l)
test "$n" -gt 0 && echo "[$n]"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment