Skip to content

includeIgnored in codegraph.json does not revive embedded git repos on init/index (v1.4.1) #1295

Description

@joaofbcastro

Summary

codegraph.json's includeIgnored (introduced in v1.1.1 per #970/#980) no longer opts gitignored embedded git repos back into the index. codegraph init/codegraph index report the repos as excluded and print the exact config the user already has as the "fix," in a loop.

Environment

  • CodeGraph: 1.4.1 (npm install, @colbymchenry/codegraph)
  • OS: macOS (Darwin arm64)
  • Project shape: a meta-repo whose root .gitignore excludes /repos/, which contains 3 independently-git-tracked projects (repos/a/, repos/b/, repos/c/), each with its own .git and its own .codegraph/ index.

Repro

.gitignore at root:

/repos/

codegraph.json at root:

{
  "includeIgnored": ["repos/a/", "repos/b/", "repos/c/"]
}

Run:

codegraph init

Actual

▲  No files found to index
▲  Your .gitignore excludes 3 nested git repositories here, so they were not indexed: repos/a, repos/b, repos/c.
●  If they're your code, add them to codegraph.json and re-index:
●    { "includeIgnored": ["repos/a/", "repos/b/", "repos/c/"] }

The suggested config is byte-for-byte identical to what's already in codegraph.json — confirmed the file is present, valid JSON, correctly parsed via python3 -m json.tool, and unmodified across codegraph uninit && codegraph init, codegraph index -f, with and without trailing slashes.

Expected

Per issue #970 (comment from @colbymchenry, 2026-06-XX): includeIgnored is documented and was originally shipped specifically to opt embedded git repos in a gitignored directory back into the index:

If you ever do want nested repos under a gitignored dir indexed, that's now an explicit opt-in via codegraph.json:
{ "includeIgnored": ["some/dir/"] }

The README (Configuration section) still documents the same contract today: "includeIgnored only revives embedded git repos, not plain source."

With the config above, codegraph init should discover and index the 3 nested repos as part of the root project.

Workaround found

Swapping the key from includeIgnored to include (documented as being for plain gitignored source, explicitly not for embedded git repos) does work — it finds and indexes all files in the nested repos:

{
  "include": ["repos/a/", "repos/b/", "repos/c/"]
}

This indexed 1105 files / 18k nodes successfully. So the file-discovery path for include correctly walks into gitignored embedded repos, but the dedicated includeIgnored path (whatever gates specifically on nested-.git detection) appears to no longer trigger — looks like a regression introduced somewhere after v1.1.1, possibly during the work that added include in #1163/PR #1063, since both features touch the same ignore/discovery logic.

Impact

Anyone relying on includeIgnored to index a "folder of repos" workspace root (the documented, supported use case per #514/#837) currently gets zero files indexed at the root, with no error beyond the exclusion notice — the suggested fix in the CLI's own message doesn't fix it. include is a viable workaround once you know to look for it, but it's a different, undocumented-for-this-purpose knob.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions