From: Jeff King <peff@peff.net>
To: Duy Nguyen <pclouds@gmail.com>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
"Git Mailing List" <git@vger.kernel.org>,
"Taylor Blau" <me@ttaylorr.com>
Subject: Re: fprintf_ln() is slow
Date: Thu, 27 Jun 2019 17:26:36 -0400 [thread overview]
Message-ID: <20190627212636.GC20250@sigill.intra.peff.net> (raw)
In-Reply-To: <CACsJy8AgmM0xYMMdYvpRSs4JRbNahcQyGcMMfPmaTS4Uv=Ok6A@mail.gmail.com>
On Thu, Jun 27, 2019 at 07:32:53PM +0700, Duy Nguyen wrote:
> > It's also not possible for translators to do this by mistake
>
> This (accidentally dropping \n which sometimes is significant) is the
> part that I made me prefer *printf_ln(). I had been translating for
> years, as far back as 2003-ish, but I've stopped since the last few
> years so I'm no longer uptodate with gettext development. And my very
> old/outdated experience with gettext might make me think it's still
> the problem.
>
> > without
> > being caught, because msgfmt will catch this (and other common issues):
> >
> > po/de.po:23: 'msgid' and 'msgstr' entries do not both end with '\n'
>
> Ok good. And with the downside of degraded performance, sure remove
> all the *printf_ln()
I don't have a strong opinion here. If you want to convert them all back
to embedded "\n", that's fine with me.
But I do suspect this same issue will come up in other places, too. For
instance, we already format into a buffer for error(), etc. Mostly for
atomic output as opposed to efficiency. And it's not just "\n", but
adding prefixes, etc.
It might be nice to have some generalized solution for writing to
stderr. And maybe it's even just using vreportf more widely. That also
caps the output length and munges unprintable characters, but that's
probably a good thing when we're going to stderr.
-Peff
next prev parent reply other threads:[~2019-06-27 21:26 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-27 5:25 fprintf_ln() is slow Jeff King
2019-06-27 5:57 ` Jeff King
2019-06-27 9:27 ` Duy Nguyen
2019-06-27 12:18 ` Ævar Arnfjörð Bjarmason
2019-06-27 12:32 ` Duy Nguyen
2019-06-27 18:04 ` Junio C Hamano
2019-06-27 21:26 ` Jeff King [this message]
2019-06-27 21:21 ` Jeff King
2019-06-27 21:55 ` Junio C Hamano
2019-06-27 12:00 ` Johannes Schindelin
2019-06-27 21:10 ` Jeff King
2019-06-28 10:03 ` Phillip Wood
2019-06-28 10:24 ` Jeff King
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190627212636.GC20250@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=me@ttaylorr.com \
--cc=pclouds@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.
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 NNTP newsgroup(s).