git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bash completion: add space between branch name and status flags
@ 2009-11-20 12:09 Roman Fietze
  2009-11-20 17:53 ` Junio C Hamano
  0 siblings, 1 reply; 7+ messages in thread
From: Roman Fietze @ 2009-11-20 12:09 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: git

Hello Shawn, hello git list members,

Wouldn't it improve the readability of the bash prompt, if there would
be a space between the branch name and the status flags (dirty, stash,
untracked)?

Signed-off-by: Roman Fietze <roman.fietze@telemotive.de>
---
 contrib/completion/git-completion.bash |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-
completion.bash
index bd66639..407176b 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -169,10 +169,12 @@ __git_ps1 ()
 			fi
 		fi
 
+		local f="$w$i$s$u$r"
+		f=${f:+ $f}
 		if [ -n "${1-}" ]; then
-			printf "$1" "$c${b##refs/heads/}$w$i$s$u$r"
+			printf "$1" "$c${b##refs/heads/}$f"
 		else
-			printf " (%s)" "$c${b##refs/heads/}$w$i$s$u$r"
+			printf " (%s)" "$c${b##refs/heads/}$f"
 		fi
 	fi
 }
-- 
1.6.4.2


Roman

-- 
Roman Fietze                Telemotive AG Büro Mühlhausen
Breitwiesen                              73347 Mühlhausen
Tel.: +49(0)7335/18493-45        http://www.telemotive.de

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-01-06 12:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-20 12:09 [PATCH] bash completion: add space between branch name and status flags Roman Fietze
2009-11-20 17:53 ` Junio C Hamano
2009-12-30 13:41   ` Nanako Shiraishi
2009-12-30 14:57     ` Shawn O. Pearce
2009-12-30 19:27       ` Junio C Hamano
2009-12-31  3:04         ` Shawn O. Pearce
2010-01-06 11:59       ` Roman Fietze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).