git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Cc: Jeff King <peff@peff.net>, Andreas Schwab <schwab@linux-m68k.org>,
	git@vger.kernel.org, "A. Wilcox" <awilfox@adelielinux.org>
Subject: Re: [musl] Re: Test failures when Git is built with libpcre and grep is built without it
Date: Tue, 10 Jan 2017 12:40:00 +0100	[thread overview]
Message-ID: <20170110113959.GL17692@port70.net> (raw)
In-Reply-To: <5874B942.7070402@adelielinux.org>

* A. Wilcox <awilfox@adelielinux.org> [2017-01-10 04:36:50 -0600]:
> On 09/01/17 15:33, Jeff King wrote:
> > The problem is that we are expecting the regex "\x{2b}" to complain
> > in regcomp() (as an ERE), but it doesn't. And that probably _is_
> > related to musl, which is providing the libc regex (I know this
> > looks like a pcre test, but it's checking that "-P -E" overrides
> > the pcre option with "-E").
> > 
> > I'm not sure if musl is wrong for failing to complain about a
> > bogus regex. Generally making something that would break into
> > something that works is an OK way to extend the standard. So our
> > test is at fault for assuming that the regex will fail. I guess

\x is undefined in posix and musl is based on tre which
supports \x{hexdigits} in ere.

(i think some bsd platforms use tre as libc regex so
i'm surprised musl is the first to run into this.)

> > we'd need to find some more exotic syntax that pcre supports, but
> > that ERE doesn't. Maybe "(?:)" or something.

i think you would have to use something that's invalid
in posix ere, ? after empty expression is undefined,
not an error so "(?:)" is a valid ere extension.

since most syntax is either defined or undefined in ere
instead of being invalid, distinguishing pcre using
syntax is not easy.

there are semantic differences in subexpression matching:
leftmost match has higher priority in pcre, longest match
has higher priority in ere.

$ echo ab | grep -o -E '(a|ab)'
ab
$ echo ab | grep -o -P '(a|ab)'
a

unfortunately grep -o is not portable.

  reply	other threads:[~2017-01-10 11:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-01  4:59 Test failures when Git is built with libpcre and grep is built without it A. Wilcox
2017-01-01 10:19 ` Torsten Bögershausen
2017-01-02  6:53 ` Jeff King
2017-01-09 10:51   ` A. Wilcox
2017-01-09 11:27     ` Jeff King
2017-01-09 13:05     ` Andreas Schwab
2017-01-09 21:33       ` Jeff King
2017-01-10 10:36         ` A. Wilcox
2017-01-10 11:40           ` Szabolcs Nagy [this message]
2017-01-11 10:04             ` [musl] " Jeff King
2017-01-11 11:10               ` [PATCH] t7810: avoid assumption about invalid regex syntax Jeff King
2017-01-11 20:49               ` [musl] Re: Test failures when Git is built with libpcre and grep is built without it 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

  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=20170110113959.GL17692@port70.net \
    --to=nsz@port70.net \
    --cc=awilfox@adelielinux.org \
    --cc=git@vger.kernel.org \
    --cc=musl@lists.openwall.com \
    --cc=peff@peff.net \
    --cc=schwab@linux-m68k.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.
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).