Re: [PATCH v4] help.c: expand options for help.autocorrect
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 25, 2020, 20:49 UTC
- Message-ID
- <xmqqk0u9duvo.fsf@gitster.c.googlers.com>
- In-Reply-To
- <20201125183309.GF8396@szeder.dev>
SZEDER Gábor <szeder.dev@gmail.com> writes:
Show 7 quoted lines
>> + grep "is not a git command" actual && >> + test_line_count = 1 actual > > The two branches of this condition are in the wrong order, as it > doesn't check the expected error message in normal mode, but it does > grep for the specific translated error message when run with > GIT_TEST_GETTEXT_POISON=1 which then fails the test.
Correct.
Show 5 quoted lines
> I think we should simply use 'test_i18ngrep' instead of that whole > if-else block. > ... > I wonder what that 'test_line_count = 1' is supposed to check, and am > not sure that it's really necessary.
I think it is to make sure that there is no other message emitted.
I prefer not to rely on the current implementation of poison that makes any message a single line message "# GETTEXT POISON #" that is an incomplete line. In other words,
main() { printf(_("%s.\n"), "hello");
error(_("goodbye"));exit(0); }
would give you a single line output with the current implementation, but there is no guarantee we won't improve the poisoning in the future.