-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Add .roogitinclude to override gitignore for code indexing and mentions #10441
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
base: main
Are you sure you want to change the base?
Add .roogitinclude to override gitignore for code indexing and mentions #10441
Conversation
…ing and mentions Introduces .roogitinclude file and VSCode settings to selectively include gitignored files in code indexing and @filename mentions. This enables AI context for generated code, build outputs, and nested repositories while maintaining git cleanliness. The feature is opt-in and fully backward compatible, with comprehensive tests and documentation included.
Review complete. All issues have been addressed.
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
…ching include patterns The previous implementation had a no-op filter that always returned true. When respectGitignore is enabled, ripgrep never returns gitignored files, so the filter couldn't re-include files that weren't in the results to begin with. This fix adds a second ripgrep call (without gitignore filtering) that specifically fetches files matching the include patterns. These results are then merged with the original results to ensure gitignored files matching include patterns are available for mentions. Addresses feedback from PR review comment in RooCodeInc#10441
Review complete. Found one minor issue:
Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
| import { Package } from "../../shared/package" | ||
| import { matchesIncludePatterns } from "../glob/list-files" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The matchesIncludePatterns import is no longer used after the second commit replaced the filter logic with the second ripgrep call. This unused import should be removed.
| import { Package } from "../../shared/package" | |
| import { matchesIncludePatterns } from "../glob/list-files" | |
| import { Package } from "../../shared/package" |
Fix it with Roo Code or mention @roomote and request a fix.
Related GitHub Issue
Closes: 8124
Description
This PR introduces the
.roogitincludefeature to allow selective inclusion of gitignored files in code indexing and @filename mentions, addressing the need to provide AI context for generated code, build outputs, and nested repositories while maintaining Git cleanliness.Implementation approach:
.roogitincludefile format (gitignore-style glob patterns) that explicitly lists paths to include even if gitignoredcodeIndex.respectGitignore(default: true),codeIndex.includePatterns(default: []), andmentions.respectGitignore(default: false).rooignore(always excluded) > include patterns >.gitignore> default (include)scanner.ts,file-watcher.ts) and file search (file-search.ts) to support include patternsKey design decisions:
.roogitinclude(not.rooinclude) to clearly indicate it overrides gitignore, not rooignore, preventing user confusion about security boundaries.roogitincludefile patterns and VSCode settings patterns, allowing team-level (committed) and user-level (local) configurationReviewers should focus on:
scanner.ts:106-111andfile-watcher.ts:524-548- ensure.rooignorecan never be overriddenfile-search.ts:114-194- verify include patterns correctly override gitignored filesTest Procedure
Automated Tests:
cd src npx vitest run services/glob/__tests__/roogitinclude.spec.ts npx vitest run services/search/__tests__/file-search.spec.ts npx vitest run services/code-index/__tests__/manager.spec.tsAll 33+ tests should pass, covering:
Create test workspace with gitignored files
Create .roogitinclude
echo "generated/api/**" > .roogitincludeVerify ALL files (except .rooignore patterns) are now indexed
Pre-Submission Checklist
Screenshots / Videos
Documentation Updates
Additional Notes
Get in Touch
Important
Adds
.roogitincludesupport for selective inclusion of gitignored files in code indexing and mentions, with new settings and priority handling..roogitincludefile to include gitignored files for code indexing and mentions.codeIndex.respectGitignore,codeIndex.includePatterns,mentions.respectGitignore..rooignore>.roogitinclude>.gitignore> default.file-watcher.ts,scanner.ts,file-search.tsto support.roogitinclude.CodeIndexManagerandCodeIndexConfigManagerto handle new settings.loadRoogitincludePatterns()andmatchesIncludePatterns()inlist-files.ts.roogitinclude.spec.tsandfile-search.spec.tsfor new functionality.This description was created by
for 3da2152. You can customize this summary. It will automatically update as commits are pushed.