Skip to content

fix(core): ignore .gemini folder by default in file search - #28866

Open
Rajeev91691 wants to merge 1 commit into
google-gemini:mainfrom
Rajeev91691:fix/filesearch-ignore-gemini-dir
Open

fix(core): ignore .gemini folder by default in file search#28866
Rajeev91691 wants to merge 1 commit into
google-gemini:mainfrom
Rajeev91691:fix/filesearch-ignore-gemini-dir

Conversation

@Rajeev91691

Copy link
Copy Markdown

This PR adds .gemini to the list of default ignored directories in loadIgnoreRules (Issue #28826).

When running the tool within workspaces that contain the .gemini configuration directory (e.g. running in user's home directory), chokidar filesystem watchers and workspace crawlers attempt to index internal directories. This causes spurious file discovery events, indexing delays, and warnings when short-lived runtime lockfiles (like projects.json.lock) are created and deleted quickly.

Adding .gemini to default ignored directories resolves this. Added unit tests in packages/core/src/utils/filesearch/ignore.test.ts to ensure .gemini is always excluded.

@Rajeev91691
Rajeev91691 requested a review from a team as a code owner August 17, 2026 23:37
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 improves file discovery performance and stability by ensuring that the .gemini configuration directory is ignored by default. This change prevents workspace crawlers and filesystem watchers from indexing internal files within .gemini, which previously caused performance overhead and false warnings in environments where this directory is present.

Highlights

  • Ignore .gemini directory: Added .gemini to the default list of ignored directories in the file search utility to prevent unnecessary indexing and spurious file events.
  • Unit testing: Added a new test case in ignore.test.ts to verify that the .gemini directory is correctly excluded by the file discovery service.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the 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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions github-actions Bot added the size/s A small PR label Aug 17, 2026
@github-actions

Copy link
Copy Markdown

📊 PR Size: size/S

  • Lines changed: 13
  • Additions: +12
  • Deletions: -1
  • Files changed: 2

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the file search utility to always include '.gemini' in the list of ignored directories, ensuring it is excluded from file discovery by default. A unit test has also been added to verify this behavior. There are no review comments, and I have no feedback to provide.

@gemini-cli gemini-cli Bot added priority/p1 Important and should be addressed in the near term. area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality labels Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agent Issues related to Core Agent, Tools, Memory, Sub-Agents, Hooks, Agent Quality priority/p1 Important and should be addressed in the near term. size/s A small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant