Merge requests

MetaCroc logo

Merge requests #

A merge request (MR) proposes applying the changes of a source branch onto a target branch. It collects approvals, holds conflict resolutions, and is merged with an explicit Merge action.

Merge requests list with requests in different states

Lifecycle #

stateDiagram-v2 direction LR state "Changes requested" as ChangesRequested state "In review" as Review { [*] --> Open [*] --> Approved: 0 approvals, no conflicts Open --> Approved: Quorum reached Approved --> Open: Required approvals raised Open --> ChangesRequested: Request changes ChangesRequested --> Open: Mark as open Open --> Stale: Marked stale (API) Stale --> Open: Diff recalculated } [*] --> Review: Create MR Review --> Merged: Merge (Approved only) Review --> Rejected: Reject Review --> Closed: Close MR (author)

The same lifecycle as plain text:

StatusMeaning
OpenWaiting for approvals and conflict resolution
Changes requestedA reviewer asked for changes; the author can Mark as open again
ApprovedQuorum reached; banner Quorum reached — complete the merge with the Merge button.
MergedChanges were applied to the target
RejectedA reviewer rejected the MR
ClosedThe author closed the MR without merging
StaleThe MR was marked outdated (Target branch changed — diff was recalculated; quorum must be obtained again.)
MetaCroc does not yet mark MRs as Stale automatically when the source or target branch changes. Stale is set through the API (PUT /v2/merge-request/{id}/stale) and cleared by recalculating the diff (PUT /v2/merge-request/{id}/recalculate). The Merge action always re-runs the comparison on current data, so a merge never overwrites independent target changes.

Create a merge request #

Click Create MR on the Merge Requests page, or Create merge request on a branch (detail button or context menu, which pre-fills the source).

Create merge request dialog

FieldDescription
TitleName of the MR
Source branch → Target branchMust differ (Source and target branch must be different.)
DescriptionOptional

The MR always contains the full change set of the source branch. MetaCroc computes the changed elements and conflicts against the target when the MR is created.

If the target requires 0 approvals and there are no conflicts, the MR is created directly as Approved.

The API also supports a partial scope (scope: PARTIAL with selected structure ids). Such MRs are marked · cherry-pick in the list. The UI dialog does not offer the selection; to move individual elements use Cherry-pick.

Review #

The MR detail shows Affected structures (with added / removed / modified counts and N unresolved conflicts), History of decisions, and the Approvals panel.

Open merge request with an unresolved conflict; Approve is disabled

ActionEffect
ApproveCounts towards the quorum. Disabled while conflicts are unresolved (Resolve {n} conflicts first) and for the author unless self-approval is allowed (You cannot approve your own merge request)
Request changesAsks What needs changing?; status Changes requested
RejectAsks for a Rejection reason; status Rejected
Close MRAuthor only; status Closed
Mark as openAuthor only, after Changes requested. Starts a new review round: earlier votes no longer count

Each user can vote once per review round. The panel shows {approvals}/{required} with Quorum reached or Approvals needed. The quorum is the target branch’s Required approvals; when that value changes, open MRs are re-evaluated immediately.

Resolve conflicts #

Click Diff on an affected structure to open the diff drawer. For every conflicting field choose Source, Target, or Custom, or use Accept all source / Accept all target. Resolutions are saved on the MR and used when merging. See Compare and diff.

Diff drawer with a conflict on the description: Target, Custom, or Source

Merge #

When the MR is Approved, the Merge button appears.

Approved merge request waiting for the Merge button

Merge:

  1. recomputes the changes between source and target on current data
  2. merges each changed element three-way (baseline, target, source) and applies the saved resolutions
  3. creates a new version on the target for each changed element (description Merged from branch {source}), applies moves and deletions, and updates relations
  4. records a merge event (who, when, scope) and sets the MR to Merged

The whole merge runs in one transaction: if anything fails, neither branch changes.

If the target has Require explicit merge action set, the executing user holds a merge lock on the target while the merge runs; another user cannot merge into it at the same time.

Merging into a protected branch is the intended way to change it.

List #

Filter pills: All, Open, Changes requested, Approved, Merged, Rejected, Closed, Stale. Columns: Merge request, Branches, Author, Changes, Quorum, Status.