Skip to content

Feature: a codegraph.json include list to force gitignored first-party source (second-VCS / SVN / Perforce) into the index #1163

Description

@luoyxy

Problem

Some projects are tracked by a second VCS (SVN, Perforce, …) alongside Git, and commit real first-party source to that VCS while deliberately listing it in .gitignore so it never lands in Git. Because CodeGraph discovers files through Git, git never lists those files and they are never indexed — even though they are genuine source the graph should cover. There is currently no way to opt them in:

  • includeIgnored only revives embedded git repositories inside a gitignored directory — not ordinary gitignored source files.
  • exclude is the opposite operation (it keeps tracked files out).

So neither existing knob can pull plain gitignored first-party source into the index.

Proposed solution

An include list in the root codegraph.json:

{ "include": ["Tools/", "Local/typescript/"] }

CodeGraph discovers those paths directly off disk (overriding .gitignore) and indexes them on the full index, incremental sync, and file-watching — on both git and non-git projects. Patterns are gitignore-style, matched against project-root-relative paths (a directory, a recursive ** glob, or a single file). An explicit exclude still wins, and built-in skips like node_modules, dist, and .git are never re-included.

This complements the existing exclude (its opposite — keep tracked files out) and includeIgnored (opt in to gitignored embedded repos).

Fix

PR #1063.

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