Summary
The add, discover, and fmt subcommands all support a --no-merge flag that skips merging duplicate workspace root sections before writing. The import subcommand currently lacks this flag, which is inconsistent.
Context
Identified during multi-model code review of PR #520 (finding #7). The _run_import() function in src/vcspull/cli/import_cmd/_common.py now uses DuplicateAwareConfigReader and merge_duplicate_workspace_roots() (added in PR #520), but does not expose a --no-merge option to skip the merge step.
Expected Behavior
$ vcspull import gh my-org \
--workspace ~/code/ \
--no-merge
When --no-merge is passed, import should preserve duplicate workspace root sections as-is in the config file, matching the behavior of vcspull add --no-merge.
Implementation Notes
- Add
--no-merge to _create_shared_parent() in _common.py
- Thread the flag through
_run_import() to conditionally skip merge_duplicate_workspace_roots()
- Follow the same pattern as
add.py's _prepare_no_merge_items() for the no-merge save path
- Use
save_config_yaml_with_items() for YAML to preserve duplicate sections
Summary
The
add,discover, andfmtsubcommands all support a--no-mergeflag that skips merging duplicate workspace root sections before writing. Theimportsubcommand currently lacks this flag, which is inconsistent.Context
Identified during multi-model code review of PR #520 (finding #7). The
_run_import()function insrc/vcspull/cli/import_cmd/_common.pynow usesDuplicateAwareConfigReaderandmerge_duplicate_workspace_roots()(added in PR #520), but does not expose a--no-mergeoption to skip the merge step.Expected Behavior
When
--no-mergeis passed,importshould preserve duplicate workspace root sections as-is in the config file, matching the behavior ofvcspull add --no-merge.Implementation Notes
--no-mergeto_create_shared_parent()in_common.py_run_import()to conditionally skipmerge_duplicate_workspace_roots()add.py's_prepare_no_merge_items()for the no-merge save pathsave_config_yaml_with_items()for YAML to preserve duplicate sections