Fix generate-config --from-setup to include sparse checkout paths#46
Open
Fix generate-config --from-setup to include sparse checkout paths#46
generate-config --from-setup to include sparse checkout paths#46Conversation
Agent-Logs-Url: https://github.com/bashandbone/submod/sessions/ba69e58e-130e-4e2e-99b7-f4416231ea2a Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
…erate_config Agent-Logs-Url: https://github.com/bashandbone/submod/sessions/ba69e58e-130e-4e2e-99b7-f4416231ea2a Co-authored-by: bashandbone <89049923+bashandbone@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix sparse checkout configurations in generate-config
Fix Apr 4, 2026
generate-config --from-setup to include sparse checkout paths
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes generate-config --from-setup so the generated submod.toml includes each submodule’s sparse checkout paths by reading them from the submodule repo’s sparse-checkout file (since this data is not stored in .gitmodules).
Changes:
- Populate
sparse_pathsduringgenerate-config --from-setupby callinggit_ops.get_sparse_patterns()per submodule. - Add
SubmoduleEntries::set_sparse_paths_for()to updatesparse_pathsand keepsparse_checkoutssynchronized. - Add a contract test asserting generated config output includes
sparse_paths.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/git_manager.rs |
Augments --from-setup config generation by pulling sparse patterns from submodule sparse-checkout configuration. |
src/config.rs |
Adds an in-place helper to set sparse_paths while attempting to keep the parallel sparse map in sync. |
tests/command_contract_tests.rs |
Adds a regression test to ensure sparse paths appear in the generated TOML. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
... and 2 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
generate-config --from-setupreads.gitmodulesto reconstruct asubmod.toml, but sparse checkout patterns live in each submodule's.git/info/sparse-checkoutfile — not.gitmodules— so they were silently dropped from the generated config.Changes
src/git_manager.rs: After reading entries from.gitmodules, iterate over each submodule path and callgit_ops.get_sparse_patterns(path)to read the sparse-checkout file. Non-empty patterns are written back onto the entry before building the config.src/config.rs: AddedSubmoduleEntries::set_sparse_paths_for(&mut self, name, paths)— updatessparse_pathson the entry in-place and keeps the parallelsparse_checkoutsmap in sync, avoiding a full clone-modify-update cycle.tests/command_contract_tests.rs: Addedtest_generate_config_from_setup_includes_sparse_paths— adds a submodule with--sparse-paths src,docs, runsgenerate-config --from-setup, and asserts the generated TOML reflects those paths.