Skip to content

Automatic Deletion of Unprotected branches on PR merge with toggleable switch #13568

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
2 of 6 tasks
iarepandemonium opened this issue Nov 14, 2020 · 9 comments · Fixed by #16049
Closed
2 of 6 tasks
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Milestone

Comments

@iarepandemonium
Copy link

  • Gitea version (or commit ref): 1.14.0+dev-208-g6280af032
  • Git version: 2.29.0
  • Operating system: Linux Ubuntu 16.04
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No (not a bug.)
  • Log gist:

Description

  • Toggleable switch at project level for use
  • if an unprotected branch is merged while switch is set to true, that branch gets deleted
  • protected branches are unaffected

Screenshots

@6543 6543 added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Nov 14, 2020
@6543
Copy link
Member

6543 commented Nov 14, 2020

similar #3905

@6543
Copy link
Member

6543 commented Nov 14, 2020

I think merge option will get to overloaded, should we make this a user and/or repo setting?

@iarepandemonium
Copy link
Author

Yes I intended it to be togglable in the repo's own settings. I don't user repos that often, I considered one at organization level, because I will be personally enabling them in most of our projects but figured it would be too annoying to have 3 options of 'organization default', on, off

@lunny
Copy link
Member

lunny commented Nov 16, 2020

Assume the situations:

  • The branch is a default branch on the same repository, send PRs from default branch to non-default branch.
  • The branch is a default branch on the forked repository.
  • The branch on forked repository has also been sent to another upstream and one PR merged but another not.
  • There are also some PRs sent to the forked repository branch. I sent a PR from the branch of my forked repositories to original, and another forked repositories sent a PR to the branch. Then before I merge the PR on my forked repositories, the PR I sent to upstream has been merged.

@lunny
Copy link
Member

lunny commented Mar 6, 2021

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

@delvh You can, but if you have many forks, you may have to change every repository. Since the fork repositories is your copy of original repositories, so the settings depends on your personal usage habit.

@jpraet
Copy link
Member

jpraet commented May 25, 2021

A checkbox like this on the merge form could already be an easy win. Even if it would be disabled by default, at least it saves you from scrolling down to the bottom of the page, clicking the delete branch button and the confirmation dialog. And it serves as a reminder too.

afbeelding

@lunny
Copy link
Member

lunny commented Jun 1, 2021

A checkbox like this on the merge form could already be an easy win. Even if it would be disabled by default, at least it saves you from scrolling down to the bottom of the page, clicking the delete branch button and the confirmation dialog. And it serves as a reminder too.

afbeelding

Maybe the text could be Delete head branch if not protected or default.

@6543
Copy link
Member

6543 commented Jun 1, 2021

I would prefere @jpraet way but hide it if the branch is protected ...

@lunny
Copy link
Member

lunny commented Jun 2, 2021

Or disable the checkbox and display the reason

@lafriks lafriks added this to the 1.15.0 milestone Jul 20, 2021
@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants