public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Cody A Taylor <cody.taylor@maternityneighborhood•com>
To: Git Mailing List <git@vger•kernel.org>
Cc: "Duy Nguyen" <pclouds@gmail•com>,
	"SZEDER Gábor" <szeder@ira•uka.de>,
	"Felipe Contreras" <felipe.contreras@gmail•com>
Subject: [PATCH v2] git prompt: Use toplevel to find untracked files.
Date: Thu, 12 Mar 2015 19:24:50 -0700 (PDT)	[thread overview]
Message-ID: <20150313021910.11996.54041@catuvm> (raw)

>From c861d5cb401110ce7d86b76c1eaa8e89e80f484e Mon Sep 17 00:00:00 2001
From: Cody A Taylor <codemister99@yahoo•com>
Date: Thu, 12 Mar 2015 20:36:44 -0400
Subject: [PATCH] git prompt: Use toplevel to find untracked files.

The __git_ps1() prompt function would not show an untracked
state when the current working directory was not a parent of
the untracked file.

Signed-off-by: Cody A Taylor <codemister99@yahoo•com>
---
 contrib/completion/git-prompt.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
index 214e859f99e7..f18aedc73be9 100644
--- a/contrib/completion/git-prompt.sh
+++ b/contrib/completion/git-prompt.sh
@@ -487,7 +487,7 @@ __git_ps1 ()
 
 		if [ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ] &&
 		   [ "$(git config --bool bash.showUntrackedFiles)" != "false" ] &&
-		   git ls-files --others --exclude-standard --error-unmatch -- '*' >/dev/null 2>/dev/null
+		   git ls-files --others --exclude-standard --error-unmatch -- ':/*' >/dev/null 2>/dev/null
 		then
 			u="%${ZSH_VERSION+%}"
 		fi
-- 
2.3.2

             reply	other threads:[~2015-03-13  2:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13  2:24 Cody A Taylor [this message]
2015-03-13  6:16 ` [PATCH v2] git prompt: Use toplevel to find untracked files Junio C Hamano
2015-03-15 11:49   ` SZEDER Gábor
2015-03-15 21:18     ` Junio C Hamano
  -- strict thread matches above, loose matches on Subject: below --
2015-03-16  0:54 Cody Taylor
2015-03-21  8:46 ` SZEDER Gábor

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=20150313021910.11996.54041@catuvm \
    --to=cody.taylor@maternityneighborhood$(echo .)com \
    --cc=felipe.contreras@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=pclouds@gmail$(echo .)com \
    --cc=szeder@ira$(echo .)uka.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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