Git development
 help / color / mirror / Atom feed
* git bug: Perl compatible regular expressions do not work as expected
@ 2023-03-25 12:31 Mario Grgic
  2023-03-25 12:42 ` Kristoffer Haugsbakk
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Mario Grgic @ 2023-03-25 12:31 UTC (permalink / raw)
  To: git

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

Initilize a new git repo, create a simple C file that you commit into the new
repo. Then search the git history using Perl compatible regular expression. 

Basically,

mkdir test
cd test
git init

Create a file 

cat <<END > test.c
int main(int argc, const char *argv[])
{
    return 0;
}
END 

git commit -m 'added test file'

Then run:

git log --all -p -G '\bmain\b'

git is compiled with pcre2 library support but does not find main word in the
file we just added.


What did you expect to happen? (Expected behavior)
git compiled with pcre2 library should support Perl compatible regular
expressions

What happened instead? (Actual behavior)
Nothing is found, when in fact the search for term is present in the git
history

What's different between what you expected and what actually happened?
git should print out the commit containing the search term.

Anything else you want to add:

git was compiled with pcre2 library. Here is output of otool -L

$ otool -L git
git:
	/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1069.24.0)
	/usr/local/lib/libpcre2-8.0.dylib (compatibility version 12.0.0, current version 12.2.0)
	/usr/local/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.13)
	/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
	/usr/local/lib/libintl.8.dylib (compatibility version 11.0.0, current version 11.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1281.100.1)
	/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1677.104.0)
	/usr/lib/libcharset.1.dylib (compatibility version 2.0.0, current version 2.0.0)


Please review the rest of the bug report below.
You can delete any lines you don't wish to share.


[System Info]
git version:
git version 2.40.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Tue Jun 21 21:18:39 PDT 2022; root:xnu-6153.141.66~1/RELEASE_X86_64 x86_64
compiler info: clang: 12.0.0 (clang-1200.0.32.21)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]
not run from a git repository - no hooks to show


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

end of thread, other threads:[~2023-03-28 17:56 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox