git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Marius Storm-Olsen <marius@storm-olsen.com>
Cc: Ted Pavlic <ted@tedpavlic.com>,
	Marius Storm-Olsen <marius@trolltech.com>,
	"Shawn O. Pearce" <spearce@spearce.org>,
	Marius Storm-Olsen <git@storm-olsen.com>,
	git <git@vger.kernel.org>
Subject: Re: [PATCH] Add bare repository indicator for __git_ps1
Date: Tue, 24 Feb 2009 22:08:50 -0800	[thread overview]
Message-ID: <7vk57fdp59.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <49A44EC6.3070800@storm-olsen.com> (Marius Storm-Olsen's message of "Tue, 24 Feb 2009 20:47:18 +0100")

Marius Storm-Olsen <marius@storm-olsen.com> writes:

> Junio, unfortunately you applied the incorrect version.
>
> It was v3 (Message-Id:
> <1235244057-16912-1-git-send-email-git@storm-olsen.com>) which was the
> correct one, since it's the one that avoids the "GIT_DIR!" in a bare
> repo. :-/

Sorry, I only was looking at the thread that had Shawn's Ack.
Is this interdiff as a fix-up Ok?

-- >8 --

Subject: [PATCH] Fixup: Add bare repository indicator for __git_ps1

Signed-off-by: Marius Storm-Olsen <git@storm-olsen.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 contrib/completion/git-completion.bash |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index a61d852..dd393cd 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -117,9 +117,14 @@ __git_ps1 ()
 
 		local w
 		local i
+		local c
 
 		if [ "true" = "$(git rev-parse --is-inside-git-dir 2>/dev/null)" ]; then
-			b="GIT_DIR!"
+			if [ "true" = "$(git config --bool core.bare 2>/dev/null)" ]; then
+				c="BARE:"
+			else
+				b="GIT_DIR!"
+			fi
 		elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
 			if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then
 				if [ "$(git config --bool bash.showDirtyState)" != "false" ]; then
@@ -135,12 +140,6 @@ __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" "$c${b##refs/heads/}$w$i$r"
-- 
1.6.2.rc1.113.ga620b

  reply	other threads:[~2009-02-25  6:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vk57fdp59.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@storm-olsen.com \
    --cc=git@vger.kernel.org \
    --cc=marius@storm-olsen.com \
    --cc=marius@trolltech.com \
    --cc=spearce@spearce.org \
    --cc=ted@tedpavlic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).