Skip to content
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

git grep is preferred over rg but is massively deficient #448

Open
zenspider opened this issue Apr 12, 2024 · 8 comments
Open

git grep is preferred over rg but is massively deficient #448

zenspider opened this issue Apr 12, 2024 · 8 comments

Comments

@zenspider
Copy link

Without any config, if any project I use that is backed by git, then dumb-jump prefers to use git grep to find definitions via dumb-jump-pick-grep-variant. The problem, in C or ruby or anything else I've tried, is that it doesn't find ANYTHING... 0% hit rate. If I set '(dumb-jump-force-searcher 'rg) then everything works well. I don't know if git grep regexps are deficient or broken because I find dumb-jump hard to navigate but the problem certainly lies with the searcher. For some reason I can't figure out, it chooses git-grep over dumb-jump-prefer-searcher, so I'm not sure what the prefer vs force distinction is for.

I would also suggest that rg be preferred over ag.

@gmichokostas
Copy link

I've got the same issue as well. If I add (setq dumb-jump-force-searcher 'rg) in my config everything works.

@mrunhap
Copy link

mrunhap commented May 11, 2024

Same here, it just don't work at all unless set force searcher, tested on python and golang.

@dpassen
Copy link

dpassen commented May 17, 2024

Duplicate of #428

@zenspider
Copy link
Author

I don't consider this a duplicate. Part of the problem, not addressed in the other issue, is ignoring my preference and choosing git grep over my settings.

@zenspider
Copy link
Author

Since this project doesn't seem to be maintained these days, I'm experimenting with a fork I'm making called dumber-jump. Only uses rg and completing-read and removes the long obsoleted functions. Much less to configure.

@jacktasia
Copy link
Owner

jacktasia commented May 17, 2024

I've got the same issue as well. If I add (setq dumb-jump-force-searcher 'rg) in my config everything works.

This is the solution if git grep doesn’t work for you. I am really confused why this one line of config is such a big deal.

The reason preferred (more like fallback) doesn’t work is because git grep is actually available and at some point git grep was considered the optimal searcher, but unfortunately git has borked its grep implementation in recent versions. It’s complicated by the fact that there are/were a very wide assortment of git versions in the wild, so I am hesitant to change that default.

This should actually default to just grep since that’s widely installed in a “just works” sense.

No great solution in my mind. If someone wants to make a fork then that’s certainly fine with me.

@pierre-rouleau
Copy link

@zenspider , I must admit I don't understand the problem either. The code has the dumb-jump-force-searcher user-option. It can be customized and takes over. What does "it ignores my preference" mean?

@zenspider
Copy link
Author

There's a 2 year old bug open on this project explaining how git grep hasn't worked for some time... so I don't feel terribly motivated to explain how the preferences are broken.

The short version:

"The preferred searcher to use 'ag, 'rg, 'git-grep, 'gnu-grep,or 'grep.
If nil then the most optimal searcher will be chosen at runtime."

there shouldn't be 2 settings for what searcher you prefer. nil says "Best Available", and everything else should be respected. Period. To have a second variable that means "no really, I want this one"? Bad design. Don't get me started.

Nevermind the fact that git grep isn't the best and has consistently been the worst for multiple years now AND has been on your radar as broken this whole time.

from the readme:

This means minimal -- and ideally zero -- configuration

So much for that.


Since it seems obvious to me that the maintainer has no intention of addressing these deficiencies, I'm going to focus on cleaning up my fork and getting it published. @jacktasia feel free to close this issue as you see fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants