Skip to content

feat: add recurse_submodules option for git submodule support#71

Closed
weirdbb91 wants to merge 1 commit intotirth8205:mainfrom
weirdbb91:feature/recurse-submodules
Closed

feat: add recurse_submodules option for git submodule support#71
weirdbb91 wants to merge 1 commit intotirth8205:mainfrom
weirdbb91:feature/recurse-submodules

Conversation

@weirdbb91
Copy link
Copy Markdown
Contributor

Add opt-in recurse_submodules parameter to build_or_update_graph, full_build, collect_all_files, and get_all_tracked_files so that files inside git submodules are included in the knowledge graph.

When enabled, git ls-files --recurse-submodules is used instead of plain git ls-files. The option can be set three ways (highest wins):

  1. Function parameter recurse_submodules=True
  2. Environment variable CRG_RECURSE_SUBMODULES=true
  3. Default: disabled (existing behavior unchanged)

This unblocks monorepo setups that use git submodules — previously the parent repo's git ls-files returned only gitlink entries for submodule directories, causing the graph builder to find zero parseable files.

Tests:

  • 4 unit tests (param, default, env-var fallback, param-overrides-env)
  • 4 integration tests with real git repos and submodules
  • Full suite: 510 passed, 0 failed

Add opt-in `recurse_submodules` parameter to `build_or_update_graph`,
`full_build`, `collect_all_files`, and `get_all_tracked_files` so that
files inside git submodules are included in the knowledge graph.

When enabled, `git ls-files --recurse-submodules` is used instead of
plain `git ls-files`.  The option can be set three ways (highest wins):

  1. Function parameter `recurse_submodules=True`
  2. Environment variable `CRG_RECURSE_SUBMODULES=true`
  3. Default: disabled (existing behavior unchanged)

This unblocks monorepo setups that use git submodules — previously the
parent repo's `git ls-files` returned only gitlink entries for
submodule directories, causing the graph builder to find zero parseable
files.

Tests:
- 4 unit tests (param, default, env-var fallback, param-overrides-env)
- 4 integration tests with real git repos and submodules
- Full suite: 510 passed, 0 failed
@weirdbb91 weirdbb91 closed this Mar 27, 2026
@weirdbb91 weirdbb91 reopened this Mar 27, 2026
@weirdbb91 weirdbb91 closed this Mar 30, 2026
@weirdbb91 weirdbb91 deleted the feature/recurse-submodules branch March 30, 2026 11:40
@tirth8205
Copy link
Copy Markdown
Owner

git submodule support (recurse_submodules option) is not in main — the current parser.py and incremental.py do not have a recurse_submodules parameter. This is a valid unimplemented feature. Worth reviving — it has 4 unit tests and 4 integration tests, and uses git ls-files --recurse-submodules only when opted in, so existing behavior is unchanged.

@weirdbb91 weirdbb91 restored the feature/recurse-submodules branch April 11, 2026 09:04
@weirdbb91 weirdbb91 reopened this Apr 11, 2026
@weirdbb91
Copy link
Copy Markdown
Contributor Author

weirdbb91 commented Apr 11, 2026

Resubmitted as a new PR rebased on the latest main to resolve merge conflicts from the original branch. No code logic
changes — only the base was updated.

@weirdbb91 weirdbb91 closed this Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants