Skip to content

Add option to include conflict markers to merge commit

Igor Drozdov requested to merge id-allow-conflicts-on-merge into master

Related issue: gitlab#232484 (closed)

To avoid displaying the changes that are already on master in the diff, we compare the branch with HEAD of the target branch: gitlab#198458 (closed). In order to do that, we artificially merge the target branch to the source branch and compare this merge-branch to the target branch. However, when the target branch conflicts with the source branch, we're unable to merge it, so currently we display master (base) version in this case.

In order to display the up-to-date master (HEAD) version even when we have the conflicts, we can do the following:

  • Merge the source branch to the target branch
  • Add the conflicts with markers to the index
  • Continue with creating the merge commit

As a result, for the first iteration, we'll have something like this in the diff:

Screen_Shot_2020-10-05_at_20.23.54

Within the future iterations, we can properly highlight the block between conflict markers

Edited by Igor Drozdov

Merge request reports