DORMANTno replies

[PATCH] completion: Add space to PS1 when showing upstream

From: Todd Zullinger <hidden>
Date: 2016-06-15 22:50:48
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help