Re: [PATCH v3 1/4] test: use "test_grep"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 30, 2025, 16:23 UTC
- Message-ID
- <xmqqplel2o6q.fsf@gitster.g>
- In-Reply-To
- <044a93014b677914870a872a9c317a46a5a81699.1751128487.git.gitgitgadget@gmail.com>
"Leon Michalak via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 7 quoted lines
> From: Leon Michalak <leonmichalak6@gmail.com> > > 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".
Show 7 quoted lines
> @@ -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.