Skip to content

Improve gitwise sync --pull UX for diverged branches #43

@drzioner

Description

@drzioner

Problem

gitwise sync --pull currently fails with a generic message when local and remote have diverged.
The command intentionally uses git pull --ff-only for safety, but users do not get enough actionable guidance.

Current message:

error: pull failed: local and remote have diverged (use merge or rebase)

Why this is confusing

  • Users often expect --pull to "just sync".
  • The command is conservative by design (FF-only), but that safety model is not obvious in the error path.

Proposed improvements

  1. Improve diverged-pull hints with explicit next steps:
    • gitwise sync --dry-run --json to inspect ahead/behind
    • git pull --rebase (recommended)
    • git pull --no-rebase (merge flow)
    • gitwise sync --push after reconciliation
  2. Document FF-only default and divergence handling in command reference under gitwise sync.
  3. Optional follow-up: support strategy flag:
    • gitwise sync --pull --strategy ff-only|rebase|merge
    • keep default ff-only for backward-compatible safety.

Acceptance criteria

  • Diverged pull error shows concrete commands in EN/ES.
  • JSON mode includes structured hint for sync_pull_diverged with strategy guidance.
  • Docs clearly explain FF-only default and divergence resolution.

Notes

This should be UX-only unless a separate proposal explicitly changes default safety semantics.

Metadata

Metadata

Assignees

Labels

area/cliCLI argparse, subcommand routing, output formattingarea/docsProject documentation, guidelines, LANGUAGE.mdarea/git-opsGit operations: audit, clean, optimize, worktree, diffkind/improvementEnhancement to existing functionalitypriority/mediumImportant but not urgentstatus/acceptedTriaged, validated, ready to work on

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions