Created
November 9, 2018 07:31
-
-
Save bas080/b26e28affb56c8acf668e0d6c7be80ed to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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