From: "René Scharfe" <l.s.r@web.de>
To: "Junio C Hamano" <gitster@pobox.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: Jeff King <peff@peff.net>,
Marco Nenciarini <marco.nenciarini@enterprisedb.com>,
git@vger.kernel.org, Diomidis Spinellis <dds@aueb.gr>
Subject: Re: BUG: git grep behave oddly with alternatives
Date: Sat, 14 Jan 2023 09:31:44 +0100 [thread overview]
Message-ID: <b2e597aa-044d-e136-43b9-afc84a1e3794@web.de> (raw)
In-Reply-To: <0e25e6b0-2eb8-40ee-7999-f2863a545a15@web.de>
Am 14.01.23 um 07:44 schrieb René Scharfe:
> Am 13.01.23 um 18:19 schrieb Junio C Hamano:
>> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>>
>>> On Thu, Jan 12 2023, Jeff King wrote:
>>>
>>>> So it does seem like all bets are off for what people can and should
>>>> expect here. Which isn't to say we should make things worse. I mostly
>>>> wondered if REG_ENHANCED might take us closer to what glibc was doing by
>>>> default, but it doesn't seem like it.
>>
>> I thought that René's "Use enhanced only when doing BRE" was fairly
>> focused, but I am very tempted to accept ...
>>
>>> There's a couple of ways out of this that I don't see in this thread:
>>>
>>> - Declare it not a problem: We have -G, -E and -P to map to BRE, ERE and
>>> PCRE. One view is to say the first two must match POSIX, another is
>>> tha whatever the platform thinks they should do is how they should
>>> act.
>>
>> ... this view. The story "BRE and ERE work via what system
>> libraries provide, and 'git grep' matches what system grep' does" is
>> an easy to understand view.
>
> That was my stance in my first reply as well. But 3632cfc248 (Use
> compatibility regex library for OSX/Darwin, 2008-09-07) explicitly
> added alternation support for BREs on macOS, and 1819ad327b (grep: fix
> multibyte regex handling under macOS, 2022-08-26) removed it seemingly
> by accident. And grep(1) does support them on macOS 13.1:
>
> $ uname -rs
> Darwin 22.2.0
> $ which grep
> /usr/bin/grep
> $ grep --version
> grep (BSD grep, GNU compatible) 2.6.0-FreeBSD
> $ grep '\(REG_STARTEND\|NeededForASAN\)' Makefile
> # Define NO_REGEX if your C library lacks regex support with REG_STARTEND
> NO_REGEX = NeededForASAN
And I neglected to copy the author of 1819ad327b until now. :-|
@Diomidis: Here's a link to the start of this thread:
https://lore.kernel.org/git/f82ae28a-fb56-8d1f-96c8-550b61439d3a@enterprisedb.com/
René
next prev parent reply other threads:[~2023-01-14 8:32 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 9:53 BUG: git grep behave oddly with alternatives Marco Nenciarini
2023-01-03 16:29 ` René Scharfe
2023-01-03 18:13 ` Marco Nenciarini
2023-01-03 20:52 ` René Scharfe
2023-01-04 6:13 ` Junio C Hamano
2023-01-04 7:46 ` Jeff King
2023-01-04 16:36 ` René Scharfe
2023-01-06 9:09 ` Jeff King
2023-01-08 0:42 ` René Scharfe
2023-01-08 1:27 ` Junio C Hamano
2023-01-11 18:56 ` Jeff King
2023-01-12 17:13 ` René Scharfe
2023-01-12 17:52 ` Ævar Arnfjörð Bjarmason
2023-01-12 21:54 ` Jeff King
2023-01-13 8:28 ` Ævar Arnfjörð Bjarmason
2023-01-13 17:19 ` Junio C Hamano
2023-01-14 6:44 ` René Scharfe
2023-01-14 8:31 ` René Scharfe [this message]
2023-01-14 12:45 ` Diomidis Spinellis
2023-01-14 16:08 ` Junio C Hamano
2023-01-13 17:24 ` René Scharfe
2023-01-13 23:03 ` René Scharfe
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=b2e597aa-044d-e136-43b9-afc84a1e3794@web.de \
--to=l.s.r@web.de \
--cc=avarab@gmail.com \
--cc=dds@aueb.gr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=marco.nenciarini@enterprisedb.com \
--cc=peff@peff.net \
/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).