git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Add bare repository indicator for __git_ps1
@ 2009-02-21 14:48 Marius Storm-Olsen
  2009-02-21 14:53 ` Marius Storm-Olsen
  2009-02-21 19:29 ` Junio C Hamano
  0 siblings, 2 replies; 27+ messages in thread
From: Marius Storm-Olsen @ 2009-02-21 14:48 UTC (permalink / raw)
  To: spearce; +Cc: git, Marius Storm-Olsen

Prefixes the branch name with "BARE:" if you're in a
bare repository.

Signed-off-by: Marius Storm-Olsen <git@storm-olsen.com>
---
 Ok, had some free cycles, so here's fixed up version.
 Based on next this time

 contrib/completion/git-completion.bash |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index ec587d2..e585d40 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -135,11 +135,17 @@ __git_ps1 ()
 			fi
 		fi
 
+		local c
+
+		if [ "true" = "$(git config --bool core.bare 2>/dev/null)" ]; then
+			c="BARE:"
+		fi
+
 		if [ -n "$b" ]; then
 			if [ -n "${1-}" ]; then
-				printf "$1" "${b##refs/heads/}$w$i$r"
+				printf "$1" "$c${b##refs/heads/}$w$i$r"
 			else
-				printf " (%s)" "${b##refs/heads/}$w$i$r"
+				printf " (%s)" "$c${b##refs/heads/}$w$i$r"
 			fi
 		fi
 	fi
-- 
1.6.2.rc1.20.g8c5b

^ permalink raw reply related	[flat|nested] 27+ messages in thread
* [PATCH] Add bare repository indicator for __git_ps1
@ 2009-02-20 14:56 Marius Storm-Olsen
  2009-02-20 16:35 ` Johannes Schindelin
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: Marius Storm-Olsen @ 2009-02-20 14:56 UTC (permalink / raw)
  To: spearce; +Cc: Git Mailing List

Prefixes the branch name with "BARE:" if you're in a
bare repository.

Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
---
 Patch tried sent via ThunderGit extension. Sorry if it's mangled :-)

 contrib/completion/git-completion.bash |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 0a3092f..c741203 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -138,10 +138,16 @@ __git_ps1 ()
 			fi
 		fi
 
+		local c
+		
+		if test "$(git config --bool core.bare)" == "true"; then
+			c="BARE:"
+		fi
+
 		if [ -n "${1-}" ]; then
-			printf "$1" "${b##refs/heads/}$w$i$r"
+			printf "$1" "$c${b##refs/heads/}$w$i$r"
 		else
-			printf " (%s)" "${b##refs/heads/}$w$i$r"
+			printf " (%s)" "$c${b##refs/heads/}$w$i$r"
 		fi
 	fi
 }
-- 
1.6.2.rc1.20.g8c5b

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

end of thread, other threads:[~2009-02-25  6:48 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-21 14:48 [PATCH] Add bare repository indicator for __git_ps1 Marius Storm-Olsen
2009-02-21 14:53 ` Marius Storm-Olsen
2009-02-21 19:29 ` Junio C Hamano
2009-02-21 19:43   ` Marius Storm-Olsen
2009-02-22 16:49     ` Junio C Hamano
2009-02-23  7:52       ` Marius Storm-Olsen
2009-02-23 15:42     ` Shawn O. Pearce
2009-02-23 16:03       ` Marius Storm-Olsen
2009-02-23 16:16         ` Shawn O. Pearce
2009-02-23 18:55           ` Marius Storm-Olsen
2009-02-24  1:35           ` Junio C Hamano
2009-02-24 14:25             ` Ted Pavlic
2009-02-24 14:46               ` Marius Storm-Olsen
2009-02-24 15:39                 ` Ted Pavlic
2009-02-24 17:01                   ` Junio C Hamano
2009-02-24 19:47                     ` Marius Storm-Olsen
2009-02-25  6:08                       ` Junio C Hamano
2009-02-25  6:46                         ` Marius Storm-Olsen
  -- strict thread matches above, loose matches on Subject: below --
2009-02-20 14:56 Marius Storm-Olsen
2009-02-20 16:35 ` Johannes Schindelin
2009-02-20 16:46   ` Thomas Rast
2009-02-20 17:13     ` Michael J Gruber
2009-02-20 22:04     ` Marius Storm-Olsen
2009-02-20 16:39 ` Michael J Gruber
2009-02-20 21:55   ` Marius Storm-Olsen
2009-02-20 17:06 ` Ted Pavlic
2009-02-20 22:00   ` Marius Storm-Olsen

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).