From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>,
git@vger.kernel.org, "Diomidis Spinellis" <dds@aueb.gr>
Subject: Re: [PATCH v3] grep: correctly identify utf-8 characters with \{b,w} in -P
Date: Tue, 17 Jan 2023 07:19:38 -0800 [thread overview]
Message-ID: <xmqqr0vt9oj9.fsf@gitster.g> (raw)
In-Reply-To: <230117.865yd5z4ke.gmgdl@evledraar.gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Tue, 17 Jan 2023 13:38:50 +0100")
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
> To argue with myself here, I'm not so sure that just making this the
> default isn't the right move, especially as the GNU grep maintainer
> seems to be convinced that that's the right thing for grep(1).
OK.
> I think calling this e.g.:
>
> grep.perl.Unicode=<bool>
> grep.patternTypePerl.Unicode=<bool>
>
> Or even:
>
> grep.patternTypePerl.Flags=u
>
> Would be better, i.e. PCRE's C API is really just mapping to the flags
> you can find in "perldoc perlre" (https://perldoc.perl.org/perlre). In
> this case the /u flag maps to the "PCRE2_UCP" API flag.
>
> That we happen to use PCRE to give ourselves "Perl" semantics is an
> implementation detail we should avoid exposing, so we could either give
> our config generic names, or literally map to the perl /flags/.
>
> For now we could just die on any "Flags" value that isn't "u".
>
> Of course all of this is predicated on us wanting to leave this as an
> opt-in, which I'm not so sure about. If it's opt-out we'll avoid this
> entire question,
Making it opt-out would also require a similar knob to turn the
"flag" off, be it a configuration variable or a command line option,
wouldn't it? I tend to agree with you that it makes sense to make
it a goal to take us closer to "grep -P" from GNU---do they have
such an opt-out knob? If not, let's make it simple by turning it
always on, which would be the simplest ;-)
Again, thanks for a careful review with concrete points.
next prev parent reply other threads:[~2023-01-17 15:20 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-08 6:23 [PATCH] grep: correctly identify utf-8 characters with \{b,w} in -P Carlo Marcelo Arenas Belón
2023-01-08 6:39 ` Junio C Hamano
2023-01-08 15:52 ` [PATCH v2] " Carlo Marcelo Arenas Belón
2023-01-09 11:35 ` Ævar Arnfjörð Bjarmason
2023-01-09 18:40 ` bug#60690: [PATCH v2] grep: correctly identify utf-8 characters with \{b, w} " Paul Eggert
2023-01-09 19:51 ` Ævar Arnfjörð Bjarmason
2023-01-09 23:12 ` Paul Eggert
2023-01-10 4:49 ` [PATCH v2] grep: correctly identify utf-8 characters with \{b,w} " Carlo Arenas
2023-01-16 20:48 ` Junio C Hamano
2023-04-03 21:38 ` -P '\d' in GNU and git grep Paul Eggert
2023-04-04 3:30 ` bug#60690: " Jim Meyering
2023-04-04 6:46 ` Paul Eggert
2023-04-04 15:31 ` Jim Meyering
2023-04-04 6:56 ` Carlo Arenas
2023-04-04 18:25 ` bug#60690: " Paul Eggert
2023-04-04 19:31 ` Junio C Hamano
2023-04-05 18:32 ` Paul Eggert
2023-04-05 19:04 ` Paul Eggert
2023-04-05 19:37 ` Junio C Hamano
2023-04-05 19:40 ` Jim Meyering
2023-04-05 20:03 ` Paul Eggert
2023-04-05 21:20 ` Carlo Arenas
2023-04-06 15:45 ` demerphq
2023-04-07 16:48 ` Paul Eggert
2023-04-06 13:39 ` demerphq
2023-04-07 19:00 ` Paul Eggert
2023-04-08 5:01 ` Carlo Arenas
2023-04-08 22:45 ` Paul Eggert
2023-01-17 10:51 ` [PATCH v3] grep: correctly identify utf-8 characters with \{b,w} in -P Carlo Marcelo Arenas Belón
2023-01-17 12:38 ` Ævar Arnfjörð Bjarmason
2023-01-17 15:19 ` Junio C Hamano [this message]
2023-01-18 7:35 ` Carlo Arenas
2023-01-18 11:49 ` Ævar Arnfjörð Bjarmason
2023-01-18 16:20 ` Junio C Hamano
2023-01-18 23:06 ` Ævar Arnfjörð Bjarmason
2023-01-18 23:24 ` Junio C Hamano
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=xmqqr0vt9oj9.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=carenas@gmail.com \
--cc=dds@aueb.gr \
--cc=git@vger.kernel.org \
/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).