Skip to content

feat(import): Add --no-merge flag for consistency with add/discover/fmt #524

@tony

Description

@tony

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions