Delete source branch when commits reach default branch
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=210251) </details> <!--IssueSummary end--> ### Problem to solve <!-- What problem do we solve? --> When creating or editing a merge request that references an unprotected source branch, there's the merge option to "Delete source branch when merge request is accepted". ![Screen_Shot_2020-03-11_at_5.29.52_PM](/uploads/37c25dc658627c563e8c25c18b297583/Screen_Shot_2020-03-11_at_5.29.52_PM.png) In scenarios where a feature branch is first merged with staging followed by staging being merged with master (see below), enabling this setting could potentially delete a feature branch before it's merged with master. For users that make use of a staging branch for manual verification and acceptance, this behavior is unacceptable. ``` First: [feature branch] --MR to--> [staging (protected)] -->(merge) --> (final manual verification & acceptance) Then later: [staging (protected)] --MR to--> [master (protected)] -->(merge) ``` ### Proposal <!-- How are we going to solve the problem? Try to include the user journey! https://about.gitlab.com/handbook/journeys/#user-journey --> A new merge option to "Delete source branch when commits reach default branch". Alternatively, the user could select a target branch that the commits must reach in order for the source branch to be deleted.
issue