Skip to content

Do not reset approvals if the only change is merging with the target branch

Problem to solve

In an MR context, in order to keep the source branch fast-forwardable, the easiest is to merge the source and target branches (some may say rebase, but let's not go into this).

However, when "Remove all approvals in a merge request when new commits are pushed to its source branch" is enabled, this merging counts as a push, and all approvals are reset, even if there has been effectively no change in the code. This creates an unnecessary workload, requiring reapproving what was already approved

Proposal

When the source branch in a MR has changed simply by merging the target branch (without conflicts), this should not count as a "push" and approvals should not be removed. Or at least there could be an option for this.

Further details

There are other cases which might similarly not require a reapproval (empty commits, rebasing, squashing), but I think these would be more difficult to detect.

Edited by Jellby