0

I need the PCRE for this command - git log -i -P --all --grep='^(?=.*fix)(?=.*a)(?=.*bug)'

It shows - fatal: cannot use Perl-compatible regexes when not compiled with USE_LIBPCRE

I tried -

brew reinstall pcre git
brew reinstall pcre2 git

And the output of the brew config is

HOMEBREW_VERSION: 3.3.16
ORIGIN: https://github.com/Homebrew/brew
HEAD: 2dc375acc2fe4e089d103171ec8fb06a87d83bb6
Last commit: 2 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 528cff0f77f4ab9f8bccfae8d148eced81eeb3d5
Core tap last commit: 39 minutes ago
Core tap branch: master
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
HOMEBREW_MAKE_JOBS: 4
Homebrew Ruby: 2.6.8 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
CPU: quad-core 64-bit kabylake
Clang: 13.0.0 build 1300
Git: 2.19.0 => /usr/local/bin/git
Curl: 7.77.0 => /usr/bin/curl
macOS: 12.2.1-x86_64
CLT: 13.0.0.0.1.1627064638
Xcode: N/A

Also followed the steps from this question - How to install Git with PCRE support on macOS with Homebrew?

joydeba
  • 778
  • 1
  • 9
  • 24

2 Answers2

1

According to brew history, git was at version 2.19 back in the year 2018. PCRE2 was optional at the time. Presently, in 2022 we are at 2.35.1 and PCRE2 comes standard.

To bring your items up-to-date:

brew update
brew upgrade
Richard Barber
  • 5,257
  • 2
  • 15
  • 26
  • `brew update` and `brew upgrade` are not working, still the version is 2.19.0. – joydeba Feb 23 '22 at 16:50
  • brew upgraded these packages only - assimp 5.2.1 -> 5.2.2 hdf5 1.12.1 -> 1.13.0 sqlite 3.37.2 -> 3.38.0 octave 6.4.0_1 -> 6.4.0_2 flac 1.3.3 -> 1.3.4 vtk 9.1.0_2 -> 9.1.0_3 netcdf 4.8.1 -> 4.8.1_1 imagemagick 7.1.0-25 -> 7.1.0-26 – joydeba Feb 23 '22 at 16:50
  • 1
    In that case, `brew uninstall git && brew install git` – Richard Barber Feb 24 '22 at 18:16
1

I found a solution, I am posting it here in case anyone needs it

  brew link --force git # showed I have another git 
  rm '/usr/local/bin/git' # had to remove it
  brew uninstall git && brew install git
  brew link --overwrite git # then linked
  brew link --overwrite --dry-run git # optional
  git --version
joydeba
  • 778
  • 1
  • 9
  • 24