-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with git-grep #428
Comments
I also ran into this with git 2.39.0. After setting debug logging with With git 2.37.1, git grep -E returns a result. With git 2.39.0, git grep -P does return a result, but I believe that option needs to be compiled in, so it may not be universally available. I could not find anything documenting a change in behavior for git grep, but I haven't had a lot of time to look or to examine any other versions. |
I had a little more time to look into this. git ships its own version of grep. Somewhere between 2.37 and 2.39, it appears that the handling of the boundary character class changed in its extended regex option. Forcing a searcher is ok, unless you're like me and use tramp to edit remote projects on machines that do not have that forced searcher installed. In this case, I'd like to use One possible solution would be to move In very limited experimentation, adding -edited for grammar |
Unfortunately, it looks like |
I think it may have been this commit that changed the git grep behavior: git/git@1819ad3 It notes changing to use the native regex library, which would account for the change from |
I also tried moving |
Not sure if it's just the boundary character. I guess we should file a bug in the git repo? |
It might be worth a try, but I'm not sure if they'd consider it a bug or not. It's using the grep style native to the platform now. It just wasn't doing that on macOS before. If they're willing to take it on as it changed expected behavior (or at least the precedent set), that would be nice. It would normalize the behavior again across platforms. Otherwise, It might be possible to detect the git version and the platform and sub the proper character classes in dumb-jump. It's already trying to detect the version and BSD/GNU for grep: Line 1835 in ba41273
And also do some substitution of character classes based on gnu-grep being present: Line 2843 in ba41273
|
There are a couple of related bugs filed with git, but not specifically dealing with extended regex: Suspected git grep regression in git 2.40.0 Filing a bug would at least get this on the radar as another side-effect. |
I did attempt to file a bug/question with git. I'll provide a link to it once I have one. It would be very nice if they fixed this on their end. Otherwise, it gets a bit complicated to detect the git version and os and sub in all the correct character classes. |
Conversation with Git: https://lore.kernel.org/git/[email protected]/T/ |
Recently, dumb-jump has failed to work for me when using the
git-grep
searcher. If I force ripgrep(setq dumb-jump-force-searcher 'rg)
, it works as I expect.git 2.39.0
dumb-jump 20220620.2325
emacs 28.2
The text was updated successfully, but these errors were encountered: