Re: [PATCH v4 6/6] builtin: send usage() help text to standard output
- From
Jeff King <peff@peff.net>
- Date
- Jan 17, 2025, 11:42 UTC
- Message-ID
- <20250117114250.GB2356746@coredump.intra.peff.net>
- In-Reply-To
- <20250116213553.2563751-7-gitster@pobox.com>
On Thu, Jan 16, 2025 at 01:35:53PM -0800, Junio C Hamano wrote:
Show 17 quoted lines
> --- a/t/t0012-help.sh > +++ b/t/t0012-help.sh > @@ -257,14 +257,8 @@ do > export GIT_CEILING_DIRECTORIES && > test_expect_code 129 git -C sub $builtin -h >output 2>err > ) && > - if test -n "$GIT_TEST_HELP_MUST_BE_STDOUT" > - then > - test_must_be_empty err && > - test_grep usage output > - else > - test_grep usage output || > - test_grep usage err > - fi > + test_must_be_empty err && > + test_grep usage output > '
Just a side note for the future: you wondered if we might ever get bitten by insisting on an empty stderr here (since it might catch warnings, etc).
If we do, I think it would be OK to just drop the test_must_be_empty line. Now that we are capturing only stdout in "output", checking that the usage message is there is probably sufficient.
In the meantime, I think I prefer keeping the slightly more strict form above.
-Peff