From 73b6bf3e23780a13ff6df6ed29c7beae7a2cc8e4 Mon Sep 17 00:00:00 2001 From: Zach Winter <222839+zachwinter@noreply.gitea.com> Date: Sun, 26 Jul 2026 01:38:10 +0000 Subject: [PATCH] fix(context): clarify the fallback login prompt wording (#1061) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Co-authored-by: Zach Winter Reviewed-on: https://gitea.com/gitea/tea/pulls/1061 Reviewed-by: Lunny Xiao Co-authored-by: Zach Winter <222839+zachwinter@noreply.gitea.com> --- modules/context/context.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/context/context.go b/modules/context/context.go index d3f49474..d739ff58 100644 --- a/modules/context/context.go +++ b/modules/context/context.go @@ -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) } }