Add preference flag_defaults.remote
, refactor #466
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: gitea/tea#466
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "noerw/tea:fix-458"
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?
This is a refactor of the code last touched in #458, making the control flow less backwards.
Additionally, this adds a preference
preferences.flag_defaults.remote
that allows to skip this heuristic and set a custom fixed default value for the--remote
flag.I'm not sure this is actually needed, I can revert that commit.
Add preference `default_remote` to skip branch based login selectionto Fix remote selection priority, add `default_remote` preference03bd42190f
to366aea4a9d
agree this is more granular
I do like the
default_remote
change, but #458 does not preferorigin
overmain
branch, actually it is kind of "fallback" whenmain
is not present, you just wrote it in different way.@arkamar Damn, I just realized that you're totally right and the priority is no different. Should make sure I'm properly awake when reviewing things next time, sorry for the noise!
But I guess this PR makes the code section more readable / less backwards, so mistakes like these are less likely ?
Fix remote selection priority, add `default_remote` preferenceto Add preference `flag_defaults.remote`, refactor@ -162,4 +167,1 @@
if len(gitConfig.Remotes) >= 1 && len(remoteValue) == 0 {
for remote := range gitConfig.Remotes {
remoteValue = remote
}
You made
tea
by default unusable for repositories with just one remote by this change. This was here to selecet at least some remote if availeble but you moved it to a part for more than one remotes. In case of one remotetea pr
prints this.fixed
@ -184,0 +188,4 @@
// make sure a remote is selected
if len(remoteValue) == 0 {
for remote := range gitConfig.Remotes {
remoteValue = remote
Maybe we can break after the first remote, there is no need to iterate through all of them.
this is breaking though for little benefit in 99% of cases