git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "SZEDER Gábor" <szeder@ira.uka.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: "SZEDER Gábor" <szeder@ira.uka.de>,
	"Git Mailing List" <git@vger.kernel.org>,
	"Duy Nguyen" <pclouds@gmail.com>,
	"Felipe Contreras" <felipe.contreras@gmail.com>,
	"Cody A Taylor" <cody.taylor@maternityneighborhood.com>
Subject: Re: [PATCH v2] git prompt: Use toplevel to find untracked files.
Date: Sun, 15 Mar 2015 12:49:04 +0100	[thread overview]
Message-ID: <1426420144-10584-1-git-send-email-szeder@ira.uka.de> (raw)
In-Reply-To: <xmqqmw3hzakn.fsf@gitster.dls.corp.google.com>

Hi,

Quoting Junio C Hamano <gitster@pobox.com>:

> Cody A Taylor <cody.taylor@maternityneighborhood.com> writes:
>> The __git_ps1() prompt function would not show an untracked
>> state when the current working directory was not a parent of
>> the untracked file.
>
> Good find, and nicely explained.

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?

> I wonder if we can add a test
> or two to t9903-bash-prompt.sh?

This test fails without the patch in question and succeeds with it.

-- 8< --

diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
index 51ecd3e..3d1a95f 100755
--- a/t/t9903-bash-prompt.sh
+++ b/t/t9903-bash-prompt.sh
@@ -397,6 +397,16 @@ test_expect_success 'prompt - untracked files status indicator - untracked files
 	test_cmp expected "$actual"
 '
 
+test_expect_success 'prompt - untracked files status indicator - untracked files outside cwd' '
+	printf " (master %%)" >expected &&
+	(
+		cd ignored_dir &&
+		GIT_PS1_SHOWUNTRACKEDFILES=y &&
+		__git_ps1 >"$actual"
+	) &&
+	test_cmp expected "$actual"
+'
+
 test_expect_success 'prompt - untracked files status indicator - shell variable unset with config disabled' '
 	printf " (master)" >expected &&
 	test_config bash.showUntrackedFiles false &&

  reply	other threads:[~2015-03-15 11:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13  2:24 [PATCH v2] git prompt: Use toplevel to find untracked files Cody A Taylor
2015-03-13  6:16 ` Junio C Hamano
2015-03-15 11:49   ` SZEDER Gábor [this message]
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=1426420144-10584-1-git-send-email-szeder@ira.uka.de \
    --to=szeder@ira.uka.de \
    --cc=cody.taylor@maternityneighborhood.com \
    --cc=felipe.contreras@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.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).