Skip to content

[Feature] Allow autodeleting branches after their PRs have been merged #14892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
delvh opened this issue Mar 5, 2021 · 8 comments
Closed

[Feature] Allow autodeleting branches after their PRs have been merged #14892

delvh opened this issue Mar 5, 2021 · 8 comments
Labels
issue/duplicate The issue has already been reported.

Comments

@delvh
Copy link
Member

delvh commented Mar 5, 2021

  • Gitea version (or commit ref): 1.14.0+dev-800-g752545023

Description

Most often, after a PR from branch a to branch b has been merged, a is not needed anymore.
It would be nice (and time/ energy saving) if you could activate in the repo settings whether branches of merged PRs should be autodeleted (as humans tend to forget to delete the branch after it has been merged, leading to unused branches in the project).

Later on, even the distinction between merged and closed PRs could be made by using another setting whether branches of closed PRs should also be autodeleted (even though that will be used rarely).

@lunny lunny added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Mar 5, 2021
@lunny
Copy link
Member

lunny commented Mar 5, 2021

So this could be a personal setting.

@delvh
Copy link
Member Author

delvh commented Mar 5, 2021

No, not really:
What is the behavior when person a commits and is basically the author of the PR, and he does not activate autodeleting branches, while person b merges the PR and has autodeletion active?
Will the branch get closed or not? Should Person B be responsible then for the deletion of the branch?

While it might be a little bit more work on the user side to check the box for each repository, it definitely leads to way less confusion and a unified solution for all PRs getting merged, instead of a per person behavior. And less confusion also means less unnecessary bug reports being filed.

@tomaswarynyca
Copy link
Contributor

I agree with @delvh it has to be a repository option.

@lunny
Copy link
Member

lunny commented Mar 5, 2021

For the original repository or fork repositories? I assume not for original repositories, because original repositories' setting should not delete fork repositories' branches there is a permission problem here.

@jolheiser
Copy link
Member

One of the (only) things Azure does that I like is, when closing a PR, it gives me a checkbox for whether to remove the branch.

The checkbox could perhaps be defaulted to some user/repo setting, but then the checkbox can be changed ad-hoc.

Obviously this would need to adhere to branch protection and other permissions

@delvh
Copy link
Member Author

delvh commented Mar 5, 2021

@lunny Can't forked repositories change the fork repo settings? I would have thought so…

@jpraet
Copy link
Member

jpraet commented Mar 5, 2021

see also #13568

@techknowlogick
Copy link
Member

closing as dupe of #13568

@techknowlogick techknowlogick added issue/duplicate The issue has already been reported. and removed type/proposal The new feature has not been accepted yet but needs to be discussed first. labels Mar 6, 2021
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/duplicate The issue has already been reported.
Projects
None yet
Development

No branches or pull requests

6 participants