git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Mario Grgic <mario_grgic@hotmail.com>,
	demerphq <demerphq@gmail.com>,
	git@vger.kernel.org
Subject: Re: git bug: Perl compatible regular expressions do not work as expected
Date: Tue, 28 Mar 2023 19:56:01 +0200	[thread overview]
Message-ID: <4e03ea47-b0aa-d69e-6c54-fcbadb3b0641@web.de> (raw)
In-Reply-To: <xmqqsfdpj8ci.fsf@gitster.g>

Am 28.03.23 um 15:47 schrieb Junio C Hamano:
> Junio C Hamano <gitster@pobox.com> writes:
>
>> I suspect that 54463d32ef was done in a conservative way to avoid
>> unintended side effects to make ERE "enhanced".  I am not 100%
>> certain, but after reading the documentation you pointed at, I do
>> not see a valid expression without ENHANCED flag starting to mean
>> totally different thing with it (well, an extra '?' turning a
>> pattern from greedy to minimal may count as such a change in
>> semantics, but I do not see anybody sensible adding an extra '?'
>> in a pattern in the first place).
>
> Sorry, but that is nonsense.  We cannot avoid being backward
> incompatible if we suddenly flip the "enhanced" bit for BRE.  A
> sane pattern written expecting non-enhanced BRE can change its
> meaning when the "enhanced" mode is enabled.

Right, and there are even more enhancements for ERE, i.e. more
incompatibilities.  Not sure how big of a problem that actually would
be, though.

> But if "enhanced" is what users want, and if that is what the other
> tools on the platform use, then perhaps flipping the "enhanced" bit
> may not be a bad idea.

Apple's grep(1) uses it, with and without -E:

https://github.com/apple-oss-distributions/text_cmds/search?q=REG_ENHANCED

E.g. awk(1) and sed(1) don't, AFAICS.

René

  reply	other threads:[~2023-03-28 17:56 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-25 12:31 git bug: Perl compatible regular expressions do not work as expected Mario Grgic
2023-03-25 12:42 ` Kristoffer Haugsbakk
2023-03-25 12:59   ` Mario Grgic
2023-03-25 13:04 ` demerphq
2023-03-25 13:09   ` Mario Grgic
2023-03-25 13:24     ` demerphq
2023-03-25 18:09     ` René Scharfe
2023-03-27 16:29       ` Junio C Hamano
2023-03-27 17:23         ` René Scharfe
2023-03-27 21:33           ` Junio C Hamano
2023-03-28 13:47             ` Junio C Hamano
2023-03-28 17:56               ` René Scharfe [this message]
2023-03-25 14:16 ` Mario Grgic
2023-03-25 15:39 ` Mario Grgic
2023-03-27 16:30   ` Junio C Hamano
2023-03-27 17:22     ` Mario Grgic
2023-03-27 21:11       ` Junio C Hamano
2023-03-28  0:03         ` Mario Grgic

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=4e03ea47-b0aa-d69e-6c54-fcbadb3b0641@web.de \
    --to=l.s.r@web.de \
    --cc=demerphq@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=mario_grgic@hotmail.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.
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).