tea branches list/protect/unprotect #645
Labels
No Label
kind/breaking
kind/bug
kind/build
kind/dependency
kind/deployment
kind/docs
kind
enhancement
kind
feature
kind/proposal
kind
question
kind
refactor
kind/security
kind/testing
kind/translation
priority/critical
priority/high
priority/low
priority/medium
reviewed/duplicate
reviewed/invalid
reviewed/wontfix
skip-changelog
status/blocked
status/has-backport
status/has-pull
status/needs-backport
status/needs-feedback
status/needs-reviews
status/wip
upstream/gitea
upstream/sdk
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/tea#645
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "leonard.vimond/tea:support_branches"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello,
This is a proposal to support consulting / protecting / unprotecting branches for a specific repository.
I copied the existing code for "issues" report and adapted to branches. There is no change of legacy code so I do not expect any impact.
Supported commands are "list", "protect", "unprotect":
What is printed now could be enriched with additional information gitea datatypes already offer.
Could you please evaluate this proposal?
I would be happy to receive any comment or remark to take into account.
tea branches unprotect --login opsi --repo opensky main
tea branches list --login opsi --repo opensky --fields name,protected,user-can-merge,user-can-push,protection
[name protected user-can-merge user-can-push protection]
+--------+-----------+----------------+---------------+------------+
| NAME | PROTECTED | USER-CAN-MERGE | USER-CAN-PUSH | PROTECTION |
+--------+-----------+----------------+---------------+------------+
| b_test | false | true | true | |
| main | false | true | true | |
+--------+-----------+----------------+---------------+------------+
tea branches protect --login opsi --repo opensky main
tea branches list --login opsi --repo opensky --fields name,protected,user-can-merge,user-can-push,protection
[name protected user-can-merge user-can-push protection]
+--------+-----------+----------------+---------------+----------------------+
| NAME | PROTECTED | USER-CAN-MERGE | USER-CAN-PUSH | PROTECTION |
+--------+-----------+----------------+---------------+----------------------+
| b_test | false | true | true | |
| main | true | true | false | - enable-push: false |
| | | | | - approving: - |
| | | | | merging: - pushing: |
| | | | | |
+--------+-----------+----------------+---------------+----------------------+
Following commands run OK:
support_branchesto tea branches list/protect/unprotecttea branches list/protect/unprotectto WIP: tea branches list/protect/unprotect@leonard.vimond Is this ready to be reviewed? If that, we can remove the WIP prefix.
WIP: tea branches list/protect/unprotectto tea branches list/protect/unprotectyes @lunny, this first contribution is complete and can be reviewed;
some more information related to BranchProtection might be added in the future, but current status is coherent.
Checkout
From your project repository, check out a new branch and test the changes.