Skip to content

Merge preview errors over a graph drop instead of reporting it unmergeable #2253

Open

Description

@bplatz

Problem

A merge preview between branches where either side dropped a graph since they forked returns an error: BranchConflict, from merge::refuse_merging_graph_drops in merge_preview.rs. The merge itself refuses the same way, which is intended, since only a fast-forward can carry a drop over. The preview's job, though, is to say whether a merge would go through, and MergePreview has a mergeable field for exactly that. A client asking "can I merge?" gets an error and has to tell "no, because of a drop" apart from a real failure.

Proposal

  • For a non-fast-forward preview where either side dropped a graph, return the preview with mergeable: false and a reason saying a graph drop blocks it, along with whatever the rest of the preview can still compute (ancestor, ahead/behind, changes when requested).
  • Leave the merge and rebase refusals as they are.
  • Decide whether the drop also appears in the preview's change summary (the dropped graph IRIs per side), so a UI can show what blocks the merge.

Tests

The preview reports mergeable: false with the drop reason in both directions (source dropped, target dropped), and a fast-forward preview over a drop is still mergeable.

Activity

  1. added
    enhancement
    P3
    area:server
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3area:serverenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions