From: Todd Zullinger Date: Fri, 18 Mar 2011 15:02:22 GMT Subject: [PATCH] completion: Add space to PS1 when showing upstream Message-ID: <20110318150222.GB26236@inocybe.localdomain> Depending on whether other changes were present or displayed in PS1, the prompt may have lacked a space between the branch and the upstream marker. Add this space as needed so the branch name and upstream state aren't confusingly mixed. Signed-off-by: Todd Zullinger --- contrib/completion/git-completion.bash | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 0b0b913..e5af5f6 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -312,6 +312,7 @@ __git_ps1 () fi local f="$w$i$s$u" + [[ -z $f ]] && p="${p:+ $p}" printf "${1:- (%s)}" "$c${b##refs/heads/}${f:+ $f}$r$p" fi } -- 1.7.4.1 -- Todd OpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Giving money and power to government is like giving whiskey and car keys to teenage boys. -- P.J. O'Rourke