fix: add opt-in initialized Git submodule indexing - #75
Open
yescine wants to merge 4 commits into
Open
Conversation
yescine
marked this pull request as ready for review
August 11, 2026 08:27
# Conflicts: # src/cli.ts
# Conflicts: # src/cli.ts # src/graph/source-files.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
graft buildbehavior: Git submodules remain excluded by default--follow-submodulesand--no-follow-submodules.graft/config.jsonCLI contract
A later
graft buildwithout either flag retains the saved choice. MCP queries do not need to pass a flag: their freshness probe and structural rebuild read the same local config.Implementation
The default path still runs the original non-recursive
git ls-files --cached --others --exclude-standard -zcommand and original filtering loop.When following is enabled, the walker identifies mode-
160000gitlinks from NUL-delimited staged output and recursively runs a child-local visibility query. This is necessary because Git's--recurse-submodulesmode cannot be combined with--others, so it cannot include visible untracked child files on its own.Only initialized gitlinks are followed. Deinitialized submodules remain absent, broken child Git metadata falls back locally, and nested children retain their own Git ignore semantics.
Validation
tsc -p tsconfig.jsontsc -p viewer/tsconfig.jsonnode scripts/build-viewer.mjsnode scripts/run-tests.mjs— 588 tests: 584 passed, 4 platform skipsCloses #74