From: Junio C Hamano Date: Wed, 25 Nov 2020 20:49:47 GMT Subject: Re: [PATCH v4] help.c: expand options for help.autocorrect Message-ID: In-Reply-To: <20201125183309.GF8396@szeder.dev> SZEDER Gábor writes: >> + 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. > 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.