public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* pcre regexps in git?
@ 2022-02-24 21:19 Anthony Heading
  2022-02-24 21:32 ` Adam Dinwoodie
  2022-02-25  0:27 ` Yasuhiro Kimura
  0 siblings, 2 replies; 7+ messages in thread
From: Anthony Heading @ 2022-02-24 21:19 UTC (permalink / raw)
  To: cygwin

Hi,
I appreciate this is just a birthday wish-list item, but...

% git grep -P hopeful...
fatal: cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE

It would be lovely (well, at least for me) if this could work.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: pcre regexps in git?
  2022-02-24 21:19 pcre regexps in git? Anthony Heading
@ 2022-02-24 21:32 ` Adam Dinwoodie
  2022-02-24 23:54   ` Allen Hewes
                     ` (2 more replies)
  2022-02-25  0:27 ` Yasuhiro Kimura
  1 sibling, 3 replies; 7+ messages in thread
From: Adam Dinwoodie @ 2022-02-24 21:32 UTC (permalink / raw)
  To: cygwin

On Thu, Feb 24, 2022 at 04:19:13PM -0500, Anthony Heading wrote:
> Hi,
> I appreciate this is just a birthday wish-list item, but...
> 
> % git grep -P hopeful...
> fatal: cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE
> 
> It would be lovely (well, at least for me) if this could work.

Huh.  I think that used to work, so if it broke, it presumably broke
somewhere during the Cygwin Git build process wrangling I've been doing
of late.  I'll see what I can do to get it working again for you!

Adam
Cygwin Git maintainer

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: pcre regexps in git?
  2022-02-24 21:32 ` Adam Dinwoodie
@ 2022-02-24 23:54   ` Allen Hewes
  2022-02-25  1:45   ` Anthony Heading
  2022-02-25  8:56   ` Adam Dinwoodie
  2 siblings, 0 replies; 7+ messages in thread
From: Allen Hewes @ 2022-02-24 23:54 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> From: Cygwin <cygwin-bounces+allen=decisiv.net@cygwin.com> On Behalf
> Of Adam Dinwoodie
> Sent: Thursday, February 24, 2022 4:32 PM
> To: cygwin@cygwin.com
> Subject: Re: pcre regexps in git?
>
> On Thu, Feb 24, 2022 at 04:19:13PM -0500, Anthony Heading wrote:
> > Hi,
> > I appreciate this is just a birthday wish-list item, but...
> >
> > % git grep -P hopeful...
> > fatal: cannot use Perl-compatible regexes when not compiled with
> > USE_LIBPCRE
> >
> > It would be lovely (well, at least for me) if this could work.
>
> Huh.  I think that used to work, so if it broke, it presumably broke
> somewhere during the Cygwin Git build process wrangling I've been doing of
> late.  I'll see what I can do to get it working again for you!
>

I use Windows git, but my Cygwin grep doesn't complain:

$ uname -a
CYGWIN_NT-10.0-19044 FOUREYES 3.3.4-341.x86_64 2022-01-31 19:35 UTC x86_64 Cygwin

$ command -v grep
alias grep='grep --color'

$ grep -P allen temp.txt | wc -l
32

$ grep --version
grep (GNU grep) 3.7
Packaged by Cygwin (3.7-2)
Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others; see
<https://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.

$ cygcheck -c grep
Cygwin Package Information
Package              Version        Status
grep                 3.7-2          OK

Am I missing something?

/allen

________________________________

Disclaimer Confidentiality Notice: This e-mail, and any attachments and/or documents linked to this email, are intended for the addressee and may contain information that is privileged, confidential, proprietary, or otherwise protected by law. Any dissemination, distribution, or copying is prohibited. This notice serves as a confidentiality marking for the purpose of any confidentiality or nondisclosure agreement. If you have received this communication in error, please contact the original sender.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: pcre regexps in git?
  2022-02-24 21:19 pcre regexps in git? Anthony Heading
  2022-02-24 21:32 ` Adam Dinwoodie
@ 2022-02-25  0:27 ` Yasuhiro Kimura
  1 sibling, 0 replies; 7+ messages in thread
From: Yasuhiro Kimura @ 2022-02-25  0:27 UTC (permalink / raw)
  To: cygwin

From: "Anthony Heading" <ajrh@ajrh.net>
Subject: pcre regexps in git?
Date: Thu, 24 Feb 2022 16:19:13 -0500

> Hi,
> I appreciate this is just a birthday wish-list item, but...
> 
> % git grep -P hopeful...
> fatal: cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE
> 
> It would be lovely (well, at least for me) if this could work.

On my 64bit Windows 10 PC `git grep -P` works fine with both cygwin64
and cygwin32.

(Cygwin64)yasu@rolling[1011]% git --version                                                         ~/Work/zsh
git version 2.35.1
(Cygwin64)yasu@rolling[1012]% git grep -P _cygpath                                                  ~/Work/zsh
Etc/ChangeLog-4.1:      Completion/Cygwin/Command/_cygpath,
Etc/ChangeLog-4.1:      Completion/Cygwin/Command/_cygpath,
Etc/ChangeLog-4.3:      Completion/Cygwin/Command/_cygpath,
(Cygwin64)yasu@rolling[1013]%

---
Yasuhiro Kimura

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: pcre regexps in git?
  2022-02-24 21:32 ` Adam Dinwoodie
  2022-02-24 23:54   ` Allen Hewes
@ 2022-02-25  1:45   ` Anthony Heading
  2022-02-25  1:54     ` Allen Hewes
  2022-02-25  8:56   ` Adam Dinwoodie
  2 siblings, 1 reply; 7+ messages in thread
From: Anthony Heading @ 2022-02-25  1:45 UTC (permalink / raw)
  To: cygwin

On Thu, Feb 24, 2022, at 4:32 PM, Adam Dinwoodie wrote:
> I'll see what I can do to get it working again for you!

Adam, that is so nice of you,  thank you!

On Thu, Feb 24, 2022, at 6:54 PM, Allen Hewes wrote:
> Am I missing something?

yup,  "git grep" not "grep"

On Thu, Feb 24, 2022, at 7:27 PM, Yasuhiro Kimura wrote:
> On my 64bit Windows 10 PC `git grep -P` works fine with both cygwin64 and cygwin32.

... which gave me that sinking embarrassing feeling that maybe I had made my own samizdat build of git in a rush one day and left it lying on my path...   :-O   but I think git checks for plain strings before calling the regex engine

/src/zsh% git grep -P _cygpath
Etc/ChangeLog-4.1:      Completion/Cygwin/Command/_cygpath,
Etc/ChangeLog-4.1:      Completion/Cygwin/Command/_cygpath,
Etc/ChangeLog-4.3:      Completion/Cygwin/Command/_cygpath,
/src/zsh% git grep -P _cygp.th
fatal: cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: pcre regexps in git?
  2022-02-25  1:45   ` Anthony Heading
@ 2022-02-25  1:54     ` Allen Hewes
  0 siblings, 0 replies; 7+ messages in thread
From: Allen Hewes @ 2022-02-25  1:54 UTC (permalink / raw)
  To: cygwin

> -----Original Message-----
> From: Cygwin <cygwin-bounces+allen=decisiv.net@cygwin.com> On Behalf
> Of Anthony Heading
> Sent: Thursday, February 24, 2022 8:45 PM
> To: cygwin@cygwin.com
> Subject: Re: pcre regexps in git?
>
> On Thu, Feb 24, 2022, at 4:32 PM, Adam Dinwoodie wrote:
> > I'll see what I can do to get it working again for you!
>
> Adam, that is so nice of you,  thank you!
>
> On Thu, Feb 24, 2022, at 6:54 PM, Allen Hewes wrote:
> > Am I missing something?
>
> yup,  "git grep" not "grep"
>

Ah ha, sorry for the noise (and more noise?). This doesn't help you, but Windows git does work for me:

production-case-dml.git on  master on ☁️  (us-east-1)
🕙 Thu Feb 24 08:49 PM  ❯ git grep -P migrations
.github/PULL_REQUEST_TEMPLATE/new_migration.md:* [] There is an existing `migrations/<project_name>` directory to hold the sql scripts.

$ git --version
git version 2.35.1.windows.2

$ which git
/cygdrive/c/Program Files/Git/cmd/git

I'll butt out now...

/allen

________________________________

Disclaimer Confidentiality Notice: This e-mail, and any attachments and/or documents linked to this email, are intended for the addressee and may contain information that is privileged, confidential, proprietary, or otherwise protected by law. Any dissemination, distribution, or copying is prohibited. This notice serves as a confidentiality marking for the purpose of any confidentiality or nondisclosure agreement. If you have received this communication in error, please contact the original sender.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: pcre regexps in git?
  2022-02-24 21:32 ` Adam Dinwoodie
  2022-02-24 23:54   ` Allen Hewes
  2022-02-25  1:45   ` Anthony Heading
@ 2022-02-25  8:56   ` Adam Dinwoodie
  2 siblings, 0 replies; 7+ messages in thread
From: Adam Dinwoodie @ 2022-02-25  8:56 UTC (permalink / raw)
  To: cygwin

On Thu, Feb 24, 2022 at 09:32:29PM +0000, Adam Dinwoodie wrote:
> On Thu, Feb 24, 2022 at 04:19:13PM -0500, Anthony Heading wrote:
> > Hi,
> > I appreciate this is just a birthday wish-list item, but...
> > 
> > % git grep -P hopeful...
> > fatal: cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE
> > 
> > It would be lovely (well, at least for me) if this could work.
> 
> Huh.  I think that used to work, so if it broke, it presumably broke
> somewhere during the Cygwin Git build process wrangling I've been doing
> of late.  I'll see what I can do to get it working again for you!

It looks like this actually broke some time ago, when the upstream Git
project moved from using libpcre1 to libpcre2, which I didn't spot, and
so didn't realise I needed to update the set of dependencies that are
installed for building Git.  Git's build-time config system is set up
such that, if it can't find a library it wants but doesn't strictly
need, it'll just silently carry on without it, so there's no indication
that there's any function missing until someone notices and complains.
So thank you, Anthony, for noticing and complaining!

(The above is not entirely true: fairly recently upstream Git added --
after I pointed out exactly this problem with a different library -- the
ability to tell the Git test suite that it should expect certain
function to be available regardless of what libraries are installed.
But I've not yet got around to setting that up for the Cygwin Git
builds, and it's unlikely to have caught this problem anyway, since it
predates that function being available.)

Anyway, the key fix here should be pretty straightforward; I think it'll
just be a case of rebuilding Git on a build server that has libpcre2
rather than libpcre1 installed.  Currently the Git builds are failing
for entirely unrelated reasons -- I understand the problem but I'm not
yet certain what the right fix is -- but I'm currently expecting to be
able to sort this all out within a week.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-02-25  8:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24 21:19 pcre regexps in git? Anthony Heading
2022-02-24 21:32 ` Adam Dinwoodie
2022-02-24 23:54   ` Allen Hewes
2022-02-25  1:45   ` Anthony Heading
2022-02-25  1:54     ` Allen Hewes
2022-02-25  8:56   ` Adam Dinwoodie
2022-02-25  0:27 ` Yasuhiro Kimura

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).