Re: [PATCH] Poison gettext with the Ook language

2018-10-27 Thread Jakub Narebski
SZEDER Gábor writes: > On Mon, Oct 22, 2018 at 05:36:33PM +0200, Nguyễn Thái Ngọc Duy wrote: >> >> The current gettext() function just replaces all strings with >> '# GETTEXT POISON #' including format strings and hides the things >> that we should be allowed to grep (like branch names, or some

Re: [PATCH] Poison gettext with the Ook language

2018-10-27 Thread Junio C Hamano
Jeff King writes: > I.e., could we mostly ignore this problem as not applying to most modern > systems? And if there is such a system, give it a fallback like: > > /* >* For systems that use a single buffer for getenv(), this hacks >* around it by giving it _four_ buffers. That's just

Re: [PATCH] Poison gettext with the Ook language

2018-10-25 Thread Jeff King
On Thu, Oct 25, 2018 at 12:52:55PM +0900, Junio C Hamano wrote: > Duy Nguyen writes: > > > The person who writes > > > > printf(_("%s"), getenv("foo")); > > > > may not go through the same thought process as with complexFunction(). > > If _() calls getenv(), because you the order of parameter

Re: [PATCH] Poison gettext with the Ook language

2018-10-24 Thread Junio C Hamano
Duy Nguyen writes: > The person who writes > > printf(_("%s"), getenv("foo")); > > may not go through the same thought process as with complexFunction(). > If _() calls getenv(), because you the order of parameter evaluation > is unspecified, you cannot be sure if getenv("foo") will be called >

Re: [PATCH] Poison gettext with the Ook language

2018-10-24 Thread Ævar Arnfjörð Bjarmason
On Wed, Oct 24 2018, Duy Nguyen wrote: > On Tue, Oct 23, 2018 at 6:45 PM Ævar Arnfjörð Bjarmason > wrote: >> >> The effect of what I'm suggesting here, and which my WIP patch in >> >> <875zxtd59e@evledraar.gmail.com> implements is that we'd do a >> >> one-time getenv() for each process

Re: [PATCH] Poison gettext with the Ook language

2018-10-24 Thread Duy Nguyen
On Tue, Oct 23, 2018 at 6:45 PM Ævar Arnfjörð Bjarmason wrote: > >> The effect of what I'm suggesting here, and which my WIP patch in > >> <875zxtd59e@evledraar.gmail.com> implements is that we'd do a > >> one-time getenv() for each process that prints a _() message that we > >> aren't doing

Re: [PATCH] Poison gettext with the Ook language

2018-10-23 Thread Ævar Arnfjörð Bjarmason
On Tue, Oct 23 2018, Duy Nguyen wrote: > On Tue, Oct 23, 2018 at 12:17 PM Ævar Arnfjörð Bjarmason > wrote: >> >> >> On Tue, Oct 23 2018, Johannes Schindelin wrote: >> >> > Hi Ævar, >> > >> > On Mon, 22 Oct 2018, Ævar Arnfjörð Bjarmason wrote: >> > >> >> So I think the only reason to keep it

Re: [PATCH] Poison gettext with the Ook language

2018-10-23 Thread Duy Nguyen
On Tue, Oct 23, 2018 at 12:17 PM Ævar Arnfjörð Bjarmason wrote: > > > On Tue, Oct 23 2018, Johannes Schindelin wrote: > > > Hi Ævar, > > > > On Mon, 22 Oct 2018, Ævar Arnfjörð Bjarmason wrote: > > > >> So I think the only reason to keep it [GETTEXT_POISON] compile-time is > >> performance, but I

Re: [PATCH] Poison gettext with the Ook language

2018-10-23 Thread Duy Nguyen
On Mon, Oct 22, 2018 at 10:23 PM SZEDER Gábor wrote: > Once upon a time a GETTEXT_POISON build job failed on me, and the > error message: > > error: # GETTEXT POISON # > > was not particularly useful. Ook wouldn't help with that... Oook? > So I came up with the following couple of patches

Re: [PATCH] Poison gettext with the Ook language

2018-10-23 Thread Johannes Schindelin
Hi Ævar, On Tue, 23 Oct 2018, Ævar Arnfjörð Bjarmason wrote: > On Tue, Oct 23 2018, Johannes Schindelin wrote: > > > On Mon, 22 Oct 2018, Ævar Arnfjörð Bjarmason wrote: > > > >> So I think the only reason to keep it [GETTEXT_POISON] compile-time is > >> performance, but I don't think that

Re: [PATCH] Poison gettext with the Ook language

2018-10-23 Thread Ævar Arnfjörð Bjarmason
On Tue, Oct 23 2018, Johannes Schindelin wrote: > Hi Ævar, > > On Mon, 22 Oct 2018, Ævar Arnfjörð Bjarmason wrote: > >> So I think the only reason to keep it [GETTEXT_POISON] compile-time is >> performance, but I don't think that matters. It's not like we're >> printing gigabytes of _()

Re: [PATCH] Poison gettext with the Ook language

2018-10-23 Thread Johannes Schindelin
Hi Ævar, On Mon, 22 Oct 2018, Ævar Arnfjörð Bjarmason wrote: > So I think the only reason to keep it [GETTEXT_POISON] compile-time is > performance, but I don't think that matters. It's not like we're > printing gigabytes of _() formatted output. Everything where formatting > matters is plumbing

Re: [PATCH] Poison gettext with the Ook language

2018-10-22 Thread Junio C Hamano
Ævar Arnfjörð Bjarmason writes: > So I think the only reason to keep it compile-time is performance, but I > don't think that matters. It's not like we're printing gigabytes of _() > formatted output. Everything where formatting matters is plumbing which > doesn't use this API. These messages

Re: [PATCH] Poison gettext with the Ook language

2018-10-22 Thread Ævar Arnfjörð Bjarmason
On Mon, Oct 22 2018, Ævar Arnfjörð Bjarmason wrote: > On Mon, Oct 22 2018, Nguyễn Thái Ngọc Duy wrote: > >> The current gettext() function just replaces all strings with >> '# GETTEXT POISON #' including format strings and hides the things >> that we should be allowed to grep (like branch

Re: [PATCH] Poison gettext with the Ook language

2018-10-22 Thread Ævar Arnfjörð Bjarmason
On Mon, Oct 22 2018, Nguyễn Thái Ngọc Duy wrote: > The current gettext() function just replaces all strings with > '# GETTEXT POISON #' including format strings and hides the things > that we should be allowed to grep (like branch names, or some other > codes) even when gettext is poisoned. > >

Re: [PATCH] Poison gettext with the Ook language

2018-10-22 Thread Johannes Schindelin
Hi Duy, On Mon, 22 Oct 2018, Nguyễn Thái Ngọc Duy wrote: > The current gettext() function just replaces all strings with > '# GETTEXT POISON #' including format strings and hides the things > that we should be allowed to grep (like branch names, or some other > codes) even when gettext is

Re: [PATCH] Poison gettext with the Ook language

2018-10-22 Thread SZEDER Gábor
On Mon, Oct 22, 2018 at 05:36:33PM +0200, Nguyễn Thái Ngọc Duy wrote: > The current gettext() function just replaces all strings with > '# GETTEXT POISON #' including format strings and hides the things > that we should be allowed to grep (like branch names, or some other > codes) even when

[PATCH] Poison gettext with the Ook language

2018-10-22 Thread Nguyễn Thái Ngọc Duy
The current gettext() function just replaces all strings with '# GETTEXT POISON #' including format strings and hides the things that we should be allowed to grep (like branch names, or some other codes) even when gettext is poisoned. This patch implements the poisoned _() with a universal and