Subject: Re: [PATCH v5 1/2] untracked-cache: test untracked-cache-bypassing behavior with -uall

From: Junio C Hamano <[email-masked]>
Date: Tue, 29 Mar 2022 09:51:21 -0700

"Tao Klerks via GitGitGadget" <[email-masked]> writes:

> +# Bypassing the untracked cache here is not desirable, but it expected
> +# in the current implementation

If that is the case, it is much more desirable to squash it into a
single [2/2] patch so that the desirable working is documented (so
future breakage can be caught), the reviewers can read what the
intended behaviour is more easily (so we do not have to be confused
by this one saying "expect success"), make it easier to cherry-pick
the fix and test in the same patch elsewhere, and the existing
breakage can easily be caught by applying only the test part of the
patch.

Thanks.

> +test_expect_success 'untracked cache is bypassed with -uall' '
> +	: >../trace.output &&
> +	GIT_TRACE2_PERF="$TRASH_DIRECTORY/trace.output" \
> +	git status -uall --porcelain >../actual &&
> +	iuc status -uall --porcelain >../status.iuc &&
> +	test_cmp ../status_uall.expect ../status.iuc &&
> +	test_cmp ../status_uall.expect ../actual &&
> +	get_relevant_traces ../trace.output ../trace.relevant &&
> +	cat >../trace.expect <<EOF &&
> + ....path:
> +EOF
> +	test_cmp ../trace.expect ../trace.relevant
> +'
> +
> +test_expect_success 'untracked cache remains after bypass' '
> +	test-tool dump-untracked-cache >../actual &&
> +	test_cmp ../dump.expect ../actual
> +'
> +
>  test_expect_success 'modify in root directory, one dir invalidation' '
>  	: >four &&
>  	test-tool chmtime =-240 four &&