fix(core): add case-insensitive flag to system grep strategy#24956
fix(core): add case-insensitive flag to system grep strategy#24956Anjaligarhwal wants to merge 1 commit intogoogle-gemini:mainfrom
Conversation
The grep tool has three search strategies that fall through on failure: git grep (--ignore-case), system grep, and JS fallback (RegExp 'i' flag). The system grep strategy was missing the -i flag, making it case-sensitive while the other two strategies are case-insensitive. This causes inconsistent search results depending on which strategy executes — specifically on non-git repositories where system grep is available but git grep is not. Add -i to the system grep args for consistent behavior across all three strategies.
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an inconsistency in the GrepTool's search strategies by enabling case-insensitive matching for the system grep implementation. This ensures that search behavior remains predictable and uniform across different environments, regardless of whether a git repository is present. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
🛑 Action Required: Evaluation ApprovalSteering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged. Maintainers:
Once approved, the evaluation results will be posted here automatically. |
Fixes #24955
What
The
GrepTooluses three cascading search strategies. Thegit grepstrategy uses--ignore-caseand the JS fallback usesRegExp(pattern, 'i'), but the systemgrepstrategy was missing the-iflag — making it case-sensitive on non-git repos where system grep is available.Fix
Add
-ito the system grep args array at line 467, consistent with the other two strategies and with theripGrep.tsimplementation (which already uses--ignore-case).Tests
grep.test.tstests pass