Skip to content

Add .git-ai/include.txt to force-index gitignored directories#18

Merged
mars167 merged 5 commits intomainfrom
copilot/update-gitignore-logic
Feb 5, 2026
Merged

Add .git-ai/include.txt to force-index gitignored directories#18
mars167 merged 5 commits intomainfrom
copilot/update-gitignore-logic

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 5, 2026

Generated code directories (e.g., from code generators, build tools) often live in .gitignore but require indexing for semantic search and code understanding. Previously, these directories were unconditionally excluded.

Changes

  • New configuration: .git-ai/include.txt in repository root's .git-ai/ directory

    • Glob patterns (one per line) to force-index specific paths
    • Overrides .gitignore but respects .aiignore
  • Priority order: .aiignore > .git-ai/include.txt > .gitignore

  • Implementation:

    • Full indexer: Two-pass glob with pattern merging
    • Incremental indexer: Pattern-based filtering with regex cache
    • Proper regex escaping for security

Example

# .gitignore
generated/
dist/

# .git-ai/include.txt
generated/api/**
generated/types/**

Result: generated/api/ and generated/types/ are indexed despite being in .gitignore. Other generated subdirectories remain excluded. Files in .aiignore are never indexed regardless of include patterns.

Pattern Syntax

  • directory/directory/** (entire directory)
  • ** → match any depth
  • * → match within segment
  • # prefix for comments

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits February 5, 2026 03:53
Co-authored-by: mars167 <29228178+mars167@users.noreply.github.com>
Co-authored-by: mars167 <29228178+mars167@users.noreply.github.com>
…regex caching

Co-authored-by: mars167 <29228178+mars167@users.noreply.github.com>
Co-authored-by: mars167 <29228178+mars167@users.noreply.github.com>
Copilot AI changed the title [WIP] Update gitignore logic to index necessary directories Add .git-ai/include.txt to force-index gitignored directories Feb 5, 2026
Copilot AI requested a review from mars167 February 5, 2026 04:01
@mars167 mars167 marked this pull request as ready for review February 5, 2026 09:20
@mars167 mars167 merged commit 85b7a53 into main Feb 5, 2026
1 check passed
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.

2 participants