mirror of
https://gitea.com/gitea/tea.git
synced 2026-07-31 19:46:35 +00:00
fix(context): clarify the fallback login prompt wording (#1061)
The prompt shown when no login matches the current repository reads: ``` NOTE: no gitea login detected, whether falling back to login 'X'? ``` Two problems, both raised by @magistra-aria in #817: - **"whether"** is a conjunction that needs two stated alternatives, so it doesn't parse in front of a yes/no confirm. - **"no gitea login detected"** is misleading. The condition is that no *configured login matched this repository's remote* — not that a Gitea instance is missing. Read literally it suggests the CLI expects gitea.com specifically, which is how at least one user (me) first misread it. Reworded to say what actually happened, for both the interactive prompt and its non-interactive counterpart: ``` NOTE: no login matched this repository. Fall back to login 'X'? ``` Strings only, no logic change. Refs #817 --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Zach Winter <contact@zachwinter.com> Reviewed-on: https://gitea.com/gitea/tea/pulls/1061 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Zach Winter <222839+zachwinter@noreply.gitea.com>
This commit is contained in:
@@ -166,7 +166,7 @@ and then run your command again`)
|
||||
if shouldPromptFallbackLogin(c.Login, canPrompt) {
|
||||
fallback := false
|
||||
if err := huh.NewConfirm().
|
||||
Title(fmt.Sprintf("NOTE: no gitea login detected, whether falling back to login '%s'?", c.Login.Name)).
|
||||
Title(fmt.Sprintf("NOTE: no login matched this repository. Fall back to login '%s'?", c.Login.Name)).
|
||||
Value(&fallback).
|
||||
WithTheme(theme.GetTheme()).
|
||||
Run(); err != nil {
|
||||
@@ -176,7 +176,7 @@ and then run your command again`)
|
||||
return nil, ErrCommandCanceled
|
||||
}
|
||||
} else if !c.Login.Default {
|
||||
fmt.Fprintf(os.Stderr, "NOTE: no gitea login detected, falling back to login '%s' in non-interactive mode.\n", c.Login.Name)
|
||||
fmt.Fprintf(os.Stderr, "NOTE: no login matched this repository, falling back to login '%s' in non-interactive mode.\n", c.Login.Name)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user