Skip to content

M4-CLI2: tend subcommand — config-driven profile execution with conflict strategies #31

Description

@hartsock

Summary

Add gitxtend tend [config] subcommand. Loads config from the cascade (or explicit path), scans all repos in parallel, then executes profiles per repo, handling all 7 conflict strategies including rebase and stash-rebase.

Blocked By

Subcommand: gitxtend tend [config] [flags]

Flags:

  • --config <path> — override cascade lookup
  • --dry-run — show what would happen without executing
  • --quiet — errors only (cron mode)
  • --profile <name> — only tend repos using this profile
  • --json — emit JSONL result per repo

Execution sequence per repo:

  1. Parallel scan_repos() pre-check (fetch=true unless --no-fetch)
  2. For each repo in config order: execute profile steps
  3. On step failure, apply conflict strategy (halt/branch/stash/overwrite/skip/rebase/stash-rebase)
  4. Report result

rebase strategy in tend

Precondition: sync_state == "diverged" AND is_clean == true
Action: rebase(path, tracking_branch)
On conflict: abort + halt

stash-rebase strategy in tend

Action: stash_push → rebase → stash_pop
On conflict: abort + stash_pop + halt

Output

Human-readable (default): mirrors gila git-tend output format
JSON (--json): one line per repo: {"path":"...","success":true,"steps":[...]}

Acceptance Criteria

  • ./target/debug/gitxtend tend --dry-run reads cascade config and reports what it would do
  • ./target/debug/gitxtend tend ~/.gitxtend runs refresh profile on configured repos
  • rebase strategy correctly resolves the diverged+clean pattern
  • cargo clippy -- -D warnings clean

Beaver (MacBook agent, Claude Sonnet 4.6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliStandalone CLI binarymilestone:M4Config + CLI (v0.4.0)parallelParallel executionrustRust implementation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions