Re: [PATCH v3 1/4] bisect--helper: normalize format string of yes/no prompts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> "Kashav Madan via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:
>
>> From: Kashav Madan <kshvmdn@xxxxxxxxx>
>>
>> Both callers of git_prompt in bisect--helper.c ask the user for yes/no
>> confirmation. They both place the question mark after the choices,
>> however this is inconsistent with how most UNIX-y tools do it. Update
>> the format string to exclude the choices from the question.
>
> Is there somewhere that the claim can be confirmed?  I am not having
> much luck with queries like
>
> https://www.google.com/search?q=prompt+question+mark+and+choices
>
> that gave https://home.csulb.edu/~murdock/choice.html the most
> relevant page X-<.
>
> I personally do not think this step is worth doing, but in any case,
> NEVER touch po/* directory when you are updating code and strings in
> the code.  It is something our i18n coordinator will do at certain
> point in the release cycle.

After reading the series through, it seems all four patches share
the same problem (i.e. swapping ? and choices, and touching po/*).

I'll discard this round, and instead queue the v2 from you, using
the proposed log message to what I wrote for you during my review.

Thanks for your first contribution, and welcome to the Git
development community ;-)

----- >8 --------- >8 --------- >8 --------- >8 --------- >8 -----
From: Kashav Madan <kshvmdn@xxxxxxxxx>
Date: Wed, 15 Dec 2021 22:58:58 +0000
Subject: [PATCH] help: make auto-correction prompt more consistent

There are three callsites of git_prompt() helper function that ask a
"yes/no" question to the end user, but one of them in help.c that
asks if the suggested auto-correction is OK, which is given when the
user makes a possible typo in a Git subcommand name, is formatted
differently from the others.

Update the format string to make the prompt string look more
consistent.

Signed-off-by: Kashav Madan <kshvmdn@xxxxxxxxx>
Signed-off-by: Junio C Hamano <gitster@xxxxxxxxx>
---
 help.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/help.c b/help.c
index 973e47cdc3..71444906dd 100644
--- a/help.c
+++ b/help.c
@@ -643,7 +643,7 @@ const char *help_unknown_cmd(const char *cmd)
 		else if (autocorrect == AUTOCORRECT_PROMPT) {
 			char *answer;
 			struct strbuf msg = STRBUF_INIT;
-			strbuf_addf(&msg, _("Run '%s' instead? (y/N)"), assumed);
+			strbuf_addf(&msg, _("Run '%s' instead [y/N]? "), assumed);
 			answer = git_prompt(msg.buf, PROMPT_ECHO);
 			strbuf_release(&msg);
 			if (!(starts_with(answer, "y") ||
-- 
2.34.1-469-g0a17e94afe




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux