git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: Drew DeVault <sir@cmpwn.com>,
	git@vger.kernel.org, lanodan <contact+git@hacktivis.me>
Subject: Re: [PATCH v4] help.c: expand options for help.autocorrect
Date: Wed, 25 Nov 2020 12:49:47 -0800	[thread overview]
Message-ID: <xmqqk0u9duvo.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20201125183309.GF8396@szeder.dev> ("SZEDER Gábor"'s message of "Wed, 25 Nov 2020 19:33:09 +0100")

SZEDER Gábor <szeder.dev@gmail.com> 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.


      reply	other threads:[~2020-11-25 20:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-18 17:28 [PATCH v4] help.c: expand options for help.autocorrect Drew DeVault
2020-11-18 18:02 ` Junio C Hamano
2020-11-18 18:15   ` Junio C Hamano
2020-11-25 18:33     ` SZEDER Gábor
2020-11-25 20:49       ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqk0u9duvo.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=contact+git@hacktivis.me \
    --cc=git@vger.kernel.org \
    --cc=sir@cmpwn.com \
    --cc=szeder.dev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).