Repository navigation
[Bug] grep skips gitignored children; README and glob include them #8580
muhammadsamir11
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Summary
@deepseek-ai/dsh-tool-fs-searchdocuments that both search tools include hidden and ignored files (excluding VCS metadata).globdoes.grepdoes not. A search whose root sits above a gitignored directory returns the sameNo matches foundas a real miss, so a model cannot tell thatnode_moduleswas pruned.This is present in published
0.2.0-rc.2and on currentmaster(packages/fs/tool-fs-search/src/grep.ts,src/glob.ts).tools.spec.tslocks the grep argv without--no-ignoreor--hidden.Reproduction
In a git repo whose root
.gitignorecontainsnode_modules, with a filevendor/node_modules/pkg/lib/index.jsthat contains the stringNEEDLE:grepwithpattern: NEEDLEandpath: vendor(ripgrep 15, the argv frombuildGrepCommand:--json --regexp=NEEDLE -- vendor).path: vendor/node_modules/pkg.globwithpattern: **/index.jsandpath: vendor.Equivalent
rg(packaged@vscode/ripgrep15.0.0):Ripgrep whitelists an explicit path even when that path is gitignored. Children that match another ignore rule are still skipped. So naming the package directory works; naming its parent does not.
Current behavior
buildGlobCommandpasses--no-ignoreand--hidden, then excludes.git,.svn,.hg,.bzr,.jj,.sl. The glob tool description says it includes hidden and ignored files.buildGrepCommandis--json,--regexp=…, optional--glob=, optional-- <path>.runRipgrepadds--no-configfor both tools. Grep does not pass--no-ignoreor--hidden. The grep tool description does not say ignored directories are skipped.No matches foundwithtotal: 0. Nothing says a gitignored child was pruned.Observed in a workspace that vendors Harness under
apps/desktop/runtime/node_modules:grepofheroWorkspaceRowwithpath: apps/desktop/runtimereturnedNo matches found. The same pattern with--no-ignorefindsdsh-client-ui-conversation/lib/client.js. A later call whose path wasapps/desktop/runtime/node_modules/@deepseek-ai/dsh-client-ui-conversationreturned matches.grepofheroWorkspaceRowwithpath: node_modulesat the repo root was a true empty (zero hits even with--no-ignore).Expected behavior
Either grep matches the README and searches hidden and ignored files the way glob does, or the README, the grep description, and the empty result say that gitignored children are skipped. A parent-directory search should not look identical to "the symbol is not there."
Adding
--no-ignoreto every grep would match the README, and it would also pullnode_modules,dist, and other ignored trees into workspace-wide searches that already stop atgrepMaxMatches(250). Those copies can crowd out project hits. A result that names the skip would fix the false empty without that cost.Environment
@deepseek-ai/dsh-tool-fs-search@0.2.0-rc.2(packages/fs/tool-fs-searchonmaster)@vscode/ripgrep15.0.0sampleOverCapGlobResults: false.All reactions