Skip to content

vendor/ directory indexed despite being excluded in root .gitignore #234

@awconstable

Description

@awconstable

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

  1. Have a PHP project with vendor/ listed in the root .gitignore
  2. Ensure vendor/ is not tracked in git (git ls-files vendor/ returns 0 results)
  3. Run index_repository on the project
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions