git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 0/3] Add bash.showUntrackedFiles config option

From
Martin Erik Werner <martinerikwerner@gmail.com>
Date
Feb 13, 2013, 10:58 UTC
Message-ID
<1360753138.25490.10.camel@mas>
In-Reply-To
<7vr4kldv2x.fsf@alter.siamese.dyndns.org>
On Tue, 2013-02-12 at 14:29 -0800, Junio C Hamano wrote:
Show 53 quoted lines
> Martin Erik Werner <martinerikwerner@gmail.com> writes:
> 
> > Add a test case for the bash.showUntrackedFiles config option, which
> > checks that the config option can disable the global effect of the
> > GIT_PS1_SHOWUNTRACKEDFILES environmant variable.
> >
> > Signed-off-by: Martin Erik Werner <martinerikwerner@gmail.com>
> > ---
> >  t/t9903-bash-prompt.sh |   11 +++++++++++
> >  1 file changed, 11 insertions(+)
> >
> > diff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh
> > index f17c1f8..c9417b9 100755
> > --- a/t/t9903-bash-prompt.sh
> > +++ b/t/t9903-bash-prompt.sh
> > @@ -447,6 +447,17 @@ test_expect_success 'prompt - untracked files status indicator - not shown insid
> >  	test_cmp expected "$actual"
> >  '
> >  
> > +test_expect_success 'prompt - untracked files status indicator - disabled by config' '
> > +	printf " (master)" > expected &&
> > +	echo "untracked" > file_untracked &&
> > +	test_config bash.showUntrackedFiles false &&
> > +	(
> > +		GIT_PS1_SHOWUNTRACKEDFILES=y &&
> > +		__git_ps1 > "$actual"
> > +	) &&
> > +	test_cmp expected "$actual"
> > +'
> 
> All six combinations need checking:
> 
>  * not having the configuration at all and not having the shell
>    variable should not show the untracked indicator (already tested).
> 
>  * not having the configuration at all and having the shell variable
>    should show the untracked indicator (already tested).
> 
>  * setting configuration to true without having the shell variable
>    should not show the untracked indicator.
> 
>  * setting configuration to true and having the shell variable
>    should show the unttracked indicator.
> 
>  * setting configuration to false and having the shell variable
>    should not show the untracked indicator (the above test checks
>    this).
> 
>  * setting configuration to false without having the shell variable
>    should not show the untracked indicator.
> 
> to prevent others from breaking the code you wrote for [PATCH 1/2],
> so you need three more tests, I guess?

Ah, yes, I was mimicing what the test did for bash.showDirtyState, I've now added the three extra tests for bash.showUntrackedFiles, which should cover all of the above cases, hopefully?

I've also added in the three extra tests for bash.showDirtyState, equivalently. These only cover the case of dirty files and not combinations with content in index, which I felt was a bit overkill, is that reasonable?

Thanks for the review :)
-- 
Martin Erik Werner <martinerikwerner@gmail.com>
Previous: Junio C HamanoNext: Martin Erik Werner
Message 6 of 20 in “Add bash.showUntrackedFiles config option”
  1. 0/2 Add bash.showUntrackedFiles config optionMartin Erik Werner, Feb 12, 2013
  2. 1/2 bash completion: add bash.showUntrackedFiles optionMartin Erik Werner, Feb 12, 2013
  3. Junio C HamanoFeb 12, 2013
  4. 2/2 t9903: add test case for bash.showUntrackedFilesMartin Erik Werner, Feb 12, 2013
  5. Junio C HamanoFeb 12, 2013
  6. 0/3 Add bash.showUntrackedFiles config optionMartin Erik Werner, Feb 13, 2013
  7. 1/3 shell prompt: add bash.showUntrackedFiles optionMartin Erik Werner, Feb 13, 2013
  8. 2/3 t9903: add tests for bash.showUntrackedFilesMartin Erik Werner, Feb 13, 2013
  9. Junio C HamanoFeb 13, 2013
  10. Martin Erik WernerFeb 13, 2013
  11. Junio C HamanoFeb 13, 2013
  12. 3/3 t9903: add extra tests for bash.showDirtyStateMartin Erik Werner, Feb 13, 2013
  13. Junio C HamanoFeb 13, 2013
  14. Martin Erik WernerFeb 13, 2013
  15. Junio C HamanoFeb 13, 2013
  16. Martin Erik WernerFeb 13, 2013
  17. Junio C HamanoFeb 13, 2013
  18. 2/3 t9903: add tests for bash.showUntrackedFilesMartin Erik Werner, Feb 13, 2013
  19. 3/3 t9903: add extra tests for bash.showDirtyStateMartin Erik Werner, Feb 13, 2013
  20. Junio C HamanoFeb 13, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.