Skip to content

feat(rag): respect .gitignore patterns when indexing documents#424

Merged
basnijholt merged 4 commits intomainfrom
feat/rag-gitignore-support
Feb 12, 2026
Merged

feat(rag): respect .gitignore patterns when indexing documents#424
basnijholt merged 4 commits intomainfrom
feat/rag-gitignore-support

Conversation

@basnijholt
Copy link
Owner

@basnijholt basnijholt commented Feb 12, 2026

Summary

  • RAG proxy now reads .gitignore files from the docs folder and parent directories up to the git repository root
  • Skips matched files during initial indexing and file watching
  • Supports wildcards (*.log), directory-only patterns (output/), rooted patterns (/secret.txt), negation (!important.log), nested path patterns (logs/*.log), and ** globbing
  • Uses stdlib matching only (no new dependencies)

Test plan

  • Existing TestShouldIgnorePath tests still pass (backwards compatible)
  • Added gitignore-focused coverage for:
    • wildcard, directory, rooted, negation, comment/blank lines
    • slash pattern no-overmatch
    • parent .gitignore loading within repo
    • not loading .gitignore above repo root
    • behavior when not in a git repo (docs-folder .gitignore only)
  • uv run pytest tests/rag
  • uv run pytest tests
  • Pre-commit checks (ruff, mypy, jscpd, pylint)

The RAG proxy now loads .gitignore files from the docs folder and its
parent directories, and skips matching files during both initial indexing
and file watching. Supports wildcards, directory-only patterns, rooted
patterns, negation, nested path patterns, and ** globbing — all using
stdlib fnmatch (no new dependencies).
@basnijholt basnijholt merged commit 1a9e9d7 into main Feb 12, 2026
10 checks passed
@basnijholt basnijholt deleted the feat/rag-gitignore-support branch February 12, 2026 06:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant