Skip to content

Harden resolve flow and improve TUI branch selection#14

Merged
mwallner merged 9 commits into
mainfrom
develop
Apr 11, 2026
Merged

Harden resolve flow and improve TUI branch selection#14
mwallner merged 9 commits into
mainfrom
develop

Conversation

@mwallner
Copy link
Copy Markdown
Owner

  • Validate merge resolution: check mergetool exit code and scan for
    remaining conflict markers before staging. Honor git's
    mergetool.trustExitCode / mergetool..trustExitCode config;
    when unset, prompt interactively or skip in --quiet mode.
  • Status: warn when current branch does not match the integration
    target encoded in the branch name; suggest the correct checkout.
  • TUI: mark current branch with ">" prefix; draw a separator between
    local and remote branches in pick_branch dialogs.
  • Detect stale local tracking branches: ensure_local_branch_for_operation
    now compares local/remote SHAs and bails with a pull suggestion
    when they diverge.
  • Add unit tests for conflict marker detection and integration tests
    for all trustExitCode variants.

- Validate merge resolution: check mergetool exit code and scan for
  remaining conflict markers before staging. Honor git's
  mergetool.trustExitCode / mergetool.<tool>.trustExitCode config;
  when unset, prompt interactively or skip in --quiet mode.
- Status: warn when current branch does not match the integration
  target encoded in the branch name; suggest the correct checkout.
- TUI: mark current branch with ">" prefix; draw a separator between
  local and remote branches in pick_branch dialogs.
- Detect stale local tracking branches: ensure_local_branch_for_operation
  now compares local/remote SHAs and bails with a pull suggestion
  when they diverge.
- Add unit tests for conflict marker detection and integration tests
  for all trustExitCode variants.
When 'mergetopus' or 'mergetopus SOURCE' targets an integration branch,
show a TUI picker asking the user whether to switch to it and view
status, or proceed with a new merge. In --quiet mode, bail with an
explicit error instead of silently redirecting.

Broaden branch discovery to cover remote-only refs so that a second
workstation (with only remote-tracking branches) can discover, resume,
and resolve existing integration contexts:

- Add branch_exists_anywhere() combining local + remote ref lookup
- Use ensure_local_branch_for_operation() to materialize tracking
  branches before checkout in merge workflow, status, and resolve paths
- Search both local and remote refs in status branch discovery
- Use best_ref_for_local_branch() for kokomeco merge suggestions

New TUI widget: pick_option() — a generic Up/Down/Enter option picker.
@mwallner mwallner merged commit 96af109 into main Apr 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant