lyze / posh-git-sh

Bash/ZSH version of the posh-git command prompt
GNU General Public License v3.0
382 stars 102 forks source link

Hide status symbol when no upstream exists #30

Closed adamkirkton closed 6 years ago

adamkirkton commented 6 years ago

Greetings, I just wanted to drop in a quick feature request to not show any status symbol for the current branch if an upstream for it does not exist. It's just a nice reminder of whether I pushed up the branch to the remote yet or not.

Thanks for the great script, I was going crazy without this after getting so used to posh-git on Windows!

lyze commented 6 years ago

Thank you for your report! This seems like a useful thing.

In 5f42ccd, I fixed a more general issue where there's no indicator for failure from git rev-list, and no upstream is a "failure" mode that trips this. I added an indicator for this, so you can customize this indicator to your liking (perhaps just to a single space?).

The more general question is relevant throughout this script in general (what is worth reporting up to the user vs trying to fall back, swallowing silently, etc.). If there are more requests similar to this, we ought to revisit this for a more principled and unified approach. I think this might be sufficient for now.

Please reopen if you think there's some more to be done for this feature.