From: Junio C Hamano <gitster@pobox•com>
To: "SZEDER Gábor" <szeder@ira•uka.de>
Cc: 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 14:18:50 -0700 [thread overview]
Message-ID: <xmqqd24at0w5.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <1426420144-10584-1-git-send-email-szeder@ira.uka.de> ("SZEDER Gábor"'s message of "Sun, 15 Mar 2015 12:49:04 +0100")
SZEDER Gábor <szeder@ira•uka.de> writes:
> 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?
Sounds good; let me use that when squashing your test updates in.
Thanks, both.
>
>> 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 &&
next prev parent reply other threads:[~2015-03-15 21:18 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
2015-03-15 21:18 ` Junio C Hamano [this message]
-- 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=xmqqd24at0w5.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=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