Add native config option to include gitignored files in search #4843

Open
opened 2026-02-16 17:45:39 -05:00 by yindo · 1 comment
Owner

Originally created by @xiaocang on GitHub (Jan 12, 2026).

Originally assigned to: @thdxr on GitHub.

Summary

Previous issues #1535 and #2517 requested the ability to include gitignored files in search results. They were closed with workarounds (RIPGREP_CONFIG_PATH, .ignore files).

This proposes a native respect_gitignore config option for a cleaner UX.

Proposed Solution

Add a respect_gitignore boolean config option:

{
  "respect_gitignore": false
}
  • Default: true (current behavior, respects .gitignore)
  • When false: includes gitignored files in glob/grep/ls results

Benefits over workarounds

  • No extra files (.ignore, .rgrc) needed
  • No environment variables required
  • Discoverable in config schema
  • Consistent across all search tools (glob, grep, ls)

Use Cases

  • Debugging build outputs or generated code
  • Referencing LLM-specific docs/plans not committed to repo
  • Working with vendored dependencies
  • Inspecting files in directories like node_modules
Originally created by @xiaocang on GitHub (Jan 12, 2026). Originally assigned to: @thdxr on GitHub. ## Summary Previous issues #1535 and #2517 requested the ability to include gitignored files in search results. They were closed with workarounds (`RIPGREP_CONFIG_PATH`, `.ignore` files). This proposes a native `respect_gitignore` config option for a cleaner UX. ## Proposed Solution Add a `respect_gitignore` boolean config option: ```json { "respect_gitignore": false } ``` - Default: `true` (current behavior, respects .gitignore) - When `false`: includes gitignored files in glob/grep/ls results ## Benefits over workarounds - No extra files (`.ignore`, `.rgrc`) needed - No environment variables required - Discoverable in config schema - Consistent across all search tools (glob, grep, ls) ## Use Cases - Debugging build outputs or generated code - Referencing LLM-specific docs/plans not committed to repo - Working with vendored dependencies - Inspecting files in directories like `node_modules`
Author
Owner

@github-actions[bot] commented on GitHub (Jan 12, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #1535: Feature request: Allow gitignored files in file search
  • #2517: A way to disable .gitignore-based filtering to the list tool
  • #4694: Files mentioned in .gitignore are not getting ignored
  • #4739: Unignoring the .gitignore with .ignore should allow reading the file

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 12, 2026): This issue might be a duplicate of existing issues. Please check: - #1535: Feature request: Allow gitignored files in file search - #2517: A way to disable .gitignore-based filtering to the `list` tool - #4694: Files mentioned in .gitignore are not getting ignored - #4739: Unignoring the .gitignore with .ignore should allow reading the file Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#4843