MoonshotAI / MoonshotAI/kimi-code
Glob searches can surface ignored files
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.5k
- Forks
- 1.2k
- Avg merge
- 11h 53m
- Merged PRs (30d)
- 350
Description
Problem
Glob documents that it respects .gitignore, .ignore, and .rgignore by default, but broad patterns can return ignored files.
Two ripgrep behaviors cause this:
- Broad patterns such as
*,**, and**/*are passed as positive--globfilters. Positive ripgrep globs can re-include files that ignore rules would otherwise exclude. - Ripgrep only applies
.gitignoreoutside git repositories when--no-require-gitis set.Globdoes not currently pass that flag for non-git search roots.
Reproduction
In a directory with:
.gitignore # contains *.log
kept.ts
ignored.log
Run Glob with pattern: "*".
Expected
kept.ts is returned and ignored.log is excluded by .gitignore.
Actual
ignored.log can be returned, including in a git repo when the broad pattern is emitted as a positive --glob, and in non-git directories because .gitignore is not honored without --no-require-git.
Notes
Useful reference patterns:
- opencode avoids a positive glob for broad discovery in its find path.
- pi walks upward for
.gitand uses--no-require-gitoutside repos.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the TypeScript Glob entry point and trace how broad patterns become ripgrep arguments; run the provided reproduction in both a Git repository and a non-Git directory. Done means kept.ts is returned while ignored.log is excluded by .gitignore for broad patterns such as *.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, typescript
- Domain
- cli, search
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100