如何在 Mac 上使用 PCRE 编译 git?
我需要此命令的 PCRE - git log -i -P --all --grep='^(?=.*fix)(?=.*a)(?=.*bug)'
它显示 - fatal: Cannot use Perl-兼容的正则表达式,当未使用 USE_LIBPCRE 编译时
我尝试过 -
brew reinstall pcre git
brew reinstall pcre2 git
并且brew配置的输出
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
也遵循了这个问题的步骤 - 如何使用 Homebrew 在 macOS 上安装带有 PCRE 支持的 Git?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据brew历史记录,
git
早在2018年就有2.19
版本。当时PCRE2
是可选的。目前,到 2022 年,我们将达到2.35.1
,并且PCRE2
将成为标准。要使您的项目保持最新状态:
According to brew history,
git
was at version2.19
back in the year 2018.PCRE2
was optional at the time. Presently, in 2022 we are at2.35.1
andPCRE2
comes standard.To bring your items up-to-date:
我找到了解决方案,我将其发布在这里以防有人需要它
I found a solution, I am posting it here in case anyone needs it