Feature Request: Automatically retarget stacked merge requests

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Proposal

It would be useful to have some way of automatically editing the target branch of a stacked diff to the target branch of the merge requests it is dependent on (or to the merge target of the prior target branch).

Context

A user can implement a "stacked" merge request on Gitlab by specifying other merge requests as dependencies and targeting the branch to stack on top of (rather than the true target branch, e.g. master). Setting this target is important since it allows only the relevant changes to be shown in the diff.

When the "base" branch is merged (and the dependency merge requests closed), one needs to manually change the target of the stacked request to be the true target branch, otherwise it will be merged with the base branch if it exists or is un-mergeable if the branch is deleted. Alternatively, one can merge stacked requests in reverse order, but this diminishes some of the benefits of stacking.

This feature would avoid frequent manually adjustment and allow for quicker merging since all requests can be approved and ready to merge as soon as dependencies are fulfilled rather than erroring out upon a base branch's merge/deletion and requiring manual intervention.

Apologies if this is a duplicate of existing feature requests or if there is a way to do this that I'm unaware of, and I appreciate your response in advance, thank you.

Edited by 🤖 GitLab Bot 🤖