Checks
Conflict prediction
2 min read
One of Versora's checks is conflict prediction: without touching your files, the app simulates the merge in memory and warns you before that a branch is going to conflict with the target. As a check, it shows up in two ways: the badge on branches and the warning before a merge or rebase.
This page sums up these two warnings. How prediction works, the prediction target, all the options, the git command and the messages are on the main page, Predicting conflicts before operating.
In the left panel (LOCAL section) and on the branch label in the graph, a conflict icon marks the
local branches that would conflict with the prediction target (when automatic, the Gitflow
develop or the remote's default branch). Hover over the icon to see the files: "Conflict
predicted: merging feature/login into main is expected to conflict in 2 files:".
The badge is recalculated on its own when the branches change. To calculate it right away, use the palette (Ctrl+P): "Refresh conflict prediction". Details in The badge on branches.
When you merge or rebase from a branch's menu, when you drag one branch onto another and in a local squash merge, Versora simulates the operation before it starts. If it's going to conflict, the Before merging (or Before rebasing) dialog opens with the Conflict predicted block and the list of files. Merge anyway (or Rebase anyway) continues; Back cancels.
Prediction never stops the operation: with no conflict predicted, or if the simulation fails, the operation goes straight ahead. Details in Before merging or rebasing.
The conflict preview for cherry-pick and revert is a different check, with its own dialog (see Conflict preview before cherry-pick and revert).
The Create merge request form also warns you when the MR is expected to conflict with the target. See In the merge request form.
In Preferences › Checks, Conflict prediction group: In the background › Predict conflicts (the badge), Before merging or rebasing › Warn when it would conflict (the dialog) and When creating a merge/pull request › Warn in the form. In In this repository, the Prediction target and Checks enabled here › Conflict prediction, which turns everything off only in that repository. The full table is in Options.
Prediction needs git 2.38 or newer; with an older git, it's unavailable. See Git version.