Description
Directories listed in a repository's root .gitignore are still being fully
indexed, despite the documentation stating that .gitignore hierarchy is
respected.
Environment
- codebase-memory-mcp: v0.6.0
- OS: Ubuntu Linux 22.04 x86_64
- Language: PHP (Composer-managed project)
Steps to reproduce
- Have a PHP project with
vendor/ listed in the root .gitignore
- Ensure
vendor/ is not tracked in git (git ls-files vendor/ returns 0 results)
- Run
index_repository on the project
- Query for nodes from the vendor directory:
search_graph(project="...", file_pattern="vendor/")
Expected behaviour
Zero results — vendor/ should be excluded per .gitignore.
Actual behaviour
The vendor directory was fully indexed, inflating the database significantly
and contributing the majority of nodes in the graph.
Workaround
Creating a .cbmignore file with vendor/ listed explicitly resolves the
issue. This suggests the .cbmignore parser works correctly but the
.gitignore parser does not handle this case.
Notes
This appears to be distinct from #178 (nested .gitignore files in
subdirectories). The affected .gitignore is at the repository root and uses
a simple unanchored pattern (vendor / vendor/) with no special syntax.
Description
Directories listed in a repository's root
.gitignoreare still being fullyindexed, despite the documentation stating that
.gitignorehierarchy isrespected.
Environment
Steps to reproduce
vendor/listed in the root.gitignorevendor/is not tracked in git (git ls-files vendor/returns 0 results)index_repositoryon the projectExpected behaviour
Zero results —
vendor/should be excluded per.gitignore.Actual behaviour
The vendor directory was fully indexed, inflating the database significantly
and contributing the majority of nodes in the graph.
Workaround
Creating a
.cbmignorefile withvendor/listed explicitly resolves theissue. This suggests the
.cbmignoreparser works correctly but the.gitignoreparser does not handle this case.Notes
This appears to be distinct from #178 (nested
.gitignorefiles insubdirectories). The affected
.gitignoreis at the repository root and usesa simple unanchored pattern (
vendor/vendor/) with no special syntax.