git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: "SZEDER Gábor" <szeder.dev@gmail.com>
Cc: Taylor Blau <me@ttaylorr.com>, Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org
Subject: Re: racy test failure in tb/upload-pack-filters
Date: Wed, 5 Aug 2020 05:26:58 -0400	[thread overview]
Message-ID: <20200805092658.GA1803042@coredump.intra.peff.net> (raw)
In-Reply-To: <20200805090641.GR2898@szeder.dev>

On Wed, Aug 05, 2020 at 11:06:41AM +0200, SZEDER Gábor wrote:

> > We can fix it by using test_i18ngrep, which just makes this grep a noop
> > in the poison mode.
> 
> I wonder whether changing that die to
> 
>   die("%s: %s", _("remote error"), buffer + 4)
> 
> would be better.

That would definitely work, but it seems sad to have to make our code
uglier. Plus I think it would hurt translations that want to format
differently (e.g., would an RTL language want to swap the order?).

It also wouldn't help other poison uses that could be expecting a "%s"
to be filled.  Another option would be to make our poison code more
realistic by copying placeholders like "%s" into the poison string. That
would fix this problem, and allow some tests to relax a bit (e.g., if
I'm looking for an error message that contains a filename, I _could_
grep for just that filename, which would never actually be translated).

But I think that gets pretty tricky, as we'd have to understand the
whole set of placeholders (e.g., that "%s" is complete after two bytes,
but "%lu" needs three bytes).

Anyway, it seemed like limiting the damage to the tests themselves was
the least bad thing.

By the way, grepping for "remote error:" shows that when we get an error
over sideband 3 we produce the same message but _don't_ translate it.
That seems inconsistent.

-Peff

  reply	other threads:[~2020-08-05  9:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-05  8:42 racy test failure in tb/upload-pack-filters Jeff King
2020-08-05  9:06 ` SZEDER Gábor
2020-08-05  9:26   ` Jeff King [this message]
2020-08-05 15:10     ` Taylor Blau
2020-08-05 16:28     ` Junio C Hamano
2020-08-07  8:56       ` [PATCH] sideband: mark "remote error:" prefix for translation Jeff King
2020-08-07 20:18         ` Junio C Hamano
2020-08-05  9:27 ` racy test failure in tb/upload-pack-filters Martin Ågren
2020-08-05 10:03   ` Jeff King
2020-08-05 11:35     ` Martin Ågren
2020-08-05 15:08 ` Taylor Blau

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=20200805092658.GA1803042@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=me@ttaylorr.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).