rtomayko / git-sh

A customized bash environment suitable for git work.
GNU General Public License v2.0
735 stars 83 forks source link

Add upstream state to PS1 #30

Closed lmars closed 11 years ago

lmars commented 11 years ago

I'm not sure if this is desired but I like to have the upstream state in my prompt (as supported by git-prompt), e.g.:

master u=    # same as upstream
master u+3   # ahead of upstream by 3 commits
master u-3   # behind upstream by 3 commits
master u+1-2 # diverged from upstream - I have one commit and they have 2 commits

There is also a less verbose version but I didn't add that as I don't use it.

rtomayko commented 11 years ago

I like this a lot personally but I wonder if we're getting to the point where we could use a system that allows for some easy customization here. Like we could include the function and document that it's available.

Merging for now. I may revert it as part of the default prompt after some use. I'll leave the function, though.

rtomayko commented 11 years ago

Thanks for the patch!

lmars commented 11 years ago

Yes I agree on the customisation, I think documenting the functions and providing some examples would be good. I actually use the functions directly myself so didn't really need to update the default prompt, so feel free to revert.