Changing the destination branch of a pull request after deletion #11647

Closed
opened 2025-11-02 09:43:23 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @tulzke on GitHub (Sep 13, 2023).

Feature Description

branch3 -> branch2 -> branch1 -> master
Now, if we have a chain of pull requests, we cannot merge branch1 first, because all other requests to branch1 will be closed without the possibility of reopening.

In bitbucket, this was solved by the fact that when deleting a branch1, all open pull requests change the target to the branch into which branch1 was merged, in our case, this is the master.

Screenshots

Here is an example in the form of a mind map.
Schema before merge branch1:
Before merge
After merge and deleting branch1:
After merge

Originally created by @tulzke on GitHub (Sep 13, 2023). ### Feature Description `branch3 -> branch2 -> branch1 -> master` Now, if we have a chain of pull requests, we cannot merge `branch1` first, because all other requests to `branch1` will be closed without the possibility of reopening. In bitbucket, this was solved by the fact that when deleting a `branch1`, all open pull requests change the target to the branch into which `branch1` was merged, in our case, this is the master. ### Screenshots Here is an example in the form of a mind map. Schema before merge `branch1`: ![Before merge](https://github.com/go-gitea/gitea/assets/62292054/65e6b121-4e29-4b13-a224-a4338207cdba) After merge and deleting `branch1`: ![After merge](https://github.com/go-gitea/gitea/assets/62292054/7fd26659-aab7-4a0e-a78c-51ed463956eb)
GiteaMirror added the type/proposal label 2025-11-02 09:43:24 -06:00
Author
Owner

@lunny commented on GitHub (Sep 14, 2023):

Retargeting all pull requests targeted branch1 to master sounds reasonable. Or we can have a prompt dialog to let users choose when deleting?

@lunny commented on GitHub (Sep 14, 2023): Retargeting all pull requests targeted branch1 to master sounds reasonable. Or we can have a prompt dialog to let users choose when deleting?
Author
Owner

@tulzke commented on GitHub (Sep 14, 2023):

Retargeting all pull requests targeted branch1 to master sounds reasonable. Or we can have a prompt dialog to let users choose when deleting?

Only before we merge branch1. It's easy to forget to do that. Why not do it automatically, as it is implemented in Bitbucket

@tulzke commented on GitHub (Sep 14, 2023): > Retargeting all pull requests targeted branch1 to master sounds reasonable. Or we can have a prompt dialog to let users choose when deleting? Only before we merge `branch1`. It's easy to forget to do that. Why not do it automatically, as it is implemented in Bitbucket
Author
Owner

@github-actions[bot] commented on GitHub (Mar 1, 2024):

Automatically locked because of our CONTRIBUTING guidelines

@github-actions[bot] commented on GitHub (Mar 1, 2024): Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#11647