From: Junio C Hamano <gitster@pobox.com>
To: Matt Gardner <four712@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: macOS git grep change in required character classes
Date: Sat, 01 Apr 2023 10:56:10 -0700 [thread overview]
Message-ID: <xmqq355jbi6d.fsf@gitster.g> (raw)
In-Reply-To: <CA+MNPvg9JX8S2fOcH9NEq=d04BcCgbf5Qwc070WWwjXpUsd3Sw@mail.gmail.com> (Matt Gardner's message of "Sat, 1 Apr 2023 13:17:03 -0400")
Matt Gardner <four712@gmail.com> writes:
> Even though the grep that ships with macOS is GNU compatible?
>
> $ which grep
> /usr/bin/grep
> $ grep -V
> grep (BSD grep) 2.5.1-FreeBSD
> $ grep -E \\btest\\b test.pl
> sub test { return; }
It seems that use of REG_ENHANCED bit (which gives some GNUism
enhancement to regex engine of BSD origin) is inconsistent even
among tools shipped by Apple,
cf. https://lore.kernel.org/git/4e03ea47-b0aa-d69e-6c54-fcbadb3b0641@web.de/
which may even contribute to the confusion.
I think we recently (of course this is after we stopped doing
NO_REGEX and switched to macOS native regex library) started using
the ENHANCED bit only for BRE and we do not use ENHANCED bit for
ERE, and the cited thread (which has "pcre" on the subject, but it
turns out that the symptom had nothing to do with pcre) discussed
possible use of the same enhanced bit for ERE by us.
prev parent reply other threads:[~2023-04-01 17:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-01 15:50 macOS git grep change in required character classes Matt Gardner
2023-04-01 16:27 ` Junio C Hamano
2023-04-01 17:17 ` Matt Gardner
2023-04-01 17:56 ` Junio C Hamano [this message]
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=xmqq355jbi6d.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=four712@gmail.com \
--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).