phiresky / ripgrep-all

rga: ripgrep, but also search in PDFs, E-Books, Office documents, zip, tar.gz, etc.
Other
6.4k stars 148 forks source link

Can't disable adapters #183

Closed runxel closed 5 months ago

runxel commented 9 months ago

Describe the bug Trying to disable adapters with --rga-adapters=-zip,sqlite does not work. Next search will still have .zip's being searched... (not helpful at all, it will just spit a lot of errors like:)

adapter: zip
Error: Unsupported Zip archive: The file length is not available in the local header

Operating System and Version MacOS 13.5.2

Output of rga --version ripgrep-all 0.9.6

phiresky commented 9 months ago

It seems to work for me on 1.0.0-alpha. Please try there

runxel commented 9 months ago

Nope, doesn't work. Gives me now preprocessor command failed errors for zips tho.

Also the whole output is now cluttered with

<somepath>/.DS_Store adapter: postprocprefix

Huh??? Other file types as well. With Alpha 5 it seems rga just looks into everything.

phiresky commented 9 months ago

I can't reproduce this. If I run rga --rga-adapters=-zip,sqlite fell in the exampledir in the repo, the result is as expected. Please send a minimal reproducible example.

runxel commented 9 months ago

Please send a minimal reproducible example.

How can I do that? Also, is this config saved somewhere so I can look into that?

lafrenierejm commented 7 months ago

Please send a minimal reproducible example.

How can I do that?

@runxel In this case, a minimum working example would mostly consist of you sharing a file that results in the buggy behavior when running rga against it. If your original file is large or contains sensitive information, you might need to construct a new file for testing. If you're willing to do a little extra work, you could even raise a PR adding that new file to exampledir/ with corresponding tests that fail.

Also, is this config saved somewhere so I can look into that?

Yes. rga uses directories-next, so the location of the config file varies by OS:

runxel commented 7 months ago

Thank you for that @lafrenierejm. So it seems the issue is with rga not updating its config.json at all. Mine is empty except for the default comment in it. How would the entry need to look like? I could then see if rga at least can read its own config file. Because this does not work:


{
    "adapters": "-zip"
}
phiresky commented 5 months ago

Both --rga-adapters=-zip and "adapters": ["-zip"] in the config file work (for me) in the newly released 0.10.3.