git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2] git prompt: Use toplevel to find untracked files.
@ 2015-03-16  0:54 Cody Taylor
  2015-03-21  8:46 ` SZEDER Gábor
  0 siblings, 1 reply; 6+ messages in thread
From: Cody Taylor @ 2015-03-16  0:54 UTC (permalink / raw)
  To: Junio C Hamano
  Cc: SZEDER Gábor, Git Mailing List, Duy Nguyen, Felipe Contreras

SZEDER Gábor <szeder@ira.uka.de> writes:
> Somehow I had a hard time making sense out of "when the current working
> directory was not a parent of the untracked file".  Perhaps "when the
> untracked files are outside of the current working directory" would be
> easier to grok?

That description doesn't cover all cases.

Scenario #1: Let's say there is an untracked file at `$ROOT/file`.
When your CWD is `$ROOT/`, all is well. If you cd to `$ROOT/src/` the
ls-files command failed to find the untracked file.

Scenario #2: Let's say there is an untracked file at `$ROOT/src/file`.
The ls-files command would find the file if the CWD is `$ROOT/` or
`$ROOT/src/`, but not if the CWD is `$ROOT/bin/` or
`$ROOT/src/folder/`.

Your description may be easier to understand, but I don't agree it's accurate.

^ permalink raw reply	[flat|nested] 6+ messages in thread
* [PATCH v2] git prompt: Use toplevel to find untracked files.
@ 2015-03-13  2:24 Cody A Taylor
  2015-03-13  6:16 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Cody A Taylor @ 2015-03-13  2:24 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Duy Nguyen, SZEDER Gábor, Felipe Contreras

>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

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

end of thread, other threads:[~2015-03-21  8:46 UTC | newest]

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

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