Subject: Re: [PATCH v3 1/4] test: use "test_grep"

From: Junio C Hamano <[email-masked]>
Date: Mon, 30 Jun 2025 09:23:41 -0700

"Leon Michalak via GitGitGadget" <[email-masked]> writes:

> From: Leon Michalak <[email-masked]>
>
> Use the modern "test_grep" test utility instead of regular "grep" which
> provides better debug information if tests fail.
>
> This is a prerequisite to the commits that follow which add to both test
> files.

Just a terminology thing, but we would phrase the last paragraph
more like

    As a preparatory clean-up, use the "test_grep" test utility
    instead of regular "grep" which provides better debug
    information if tests fail.

to avoid saying "This does X", "This commit is Y", etc.  It also
avoids giving a wrong impression by misusing the word "prerequisite"
which we almost always use for a step that cannot be skipped.  While
we add new tests to the same file, we _could_ leave these existing
tests as-is, but there is a good reason to making this change
beforehand, which we often call is a "preparatory clean-up".

> @@ -86,7 +86,7 @@ test_expect_success 'revert works (initial)' '
>  	git add file &&
>  	test_write_lines r 1 | git add -i &&
>  	git ls-files >output &&
> -	! grep . output
> +	test_grep ! . output
>  '

Good (we sometime see people got the negation wrong).

Thanks.