git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] help: add space after autocorrect prompt

From
Johannes Altmanninger <aclopte@gmail.com>
Date
Dec 16, 2021, 06:27 UTC
Message-ID
<20211216062709.b4tcagi6qcqhasrh@gmail.com>
In-Reply-To
<xmqqh7b933ej.fsf@gitster.g>
On Wed, Dec 15, 2021 at 02:32:36PM -0800, Junio C Hamano wrote:
Show 35 quoted lines
> "kashav madan via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
> > From: Kashav Madan <kshvmdn@gmail.com>
> >
> > Signed-off-by: Kashav Madan <kshvmdn@gmail.com>
> > ---
> >     help: add space after autocorrect prompt
> 
> The patch looks OK-ish, but let's make sure.  We will find what we
> should write in the log message while doing so.
> 
> If you look at the output from
> 
>     $ git grep -C2 git_prompt \*.c
> 
> you'll notice that existing message given to git_prompt look like
> these:
> 
>     yesno = git_prompt(_("Are you sure [Y/n]? "), PROMPT_ECHO);
> 
>     yesno = git_prompt(_("Do you want me to do it for you "
>                          "[Y/n]? "), PROMPT_ECHO);
> 
>     strbuf_addf(&msg, _("Run '%s' instead? (y/N)"), assumed);
>     answer = git_prompt(msg.buf, PROMPT_ECHO);
> 
> The last one is what you are touching in this patch.
> 
> There is another one in credential.c that asks not just a single
> yes/no answer, so it is justifiably different from all the others,
> but the one you noticed is different from what we see above in three
> points:
> 
>  - It does not leave a SP before where the end-user input goes;
>  - It append (y/N) _after_ question mark;
I actually prefer this one;
	Run 'status' instead? [y/N] 
sounds better than
	Run 'status' instead [y/N]? 
but that's not a strong opinion.
Previous: Junio C HamanoNext: Eric Sunshine
Message 3 of 14 in “help: add space after autocorrect prompt”
  1. help: add space after autocorrect promptkashav madan via GitGitGadget, Dec 15, 2021
  2. Junio C HamanoDec 15, 2021
  3. Johannes AltmanningerDec 16, 2021
  4. Eric SunshineDec 16, 2021
  5. Junio C HamanoDec 16, 2021
  6. help: make auto-correction prompt more consistentkashav madan via GitGitGadget, Dec 15, 2021
  7. Junio C HamanoDec 16, 2021
  8. 0/4 normalize format of yes/no promptskashav madan via GitGitGadget, Dec 16, 2021
  9. 2/4 clean: normalize format string of yes/no promptKashav Madan via GitGitGadget, Dec 16, 2021
  10. 1/4 bisect--helper: normalize format string of yes/no promptsKashav Madan via GitGitGadget, Dec 16, 2021
  11. Junio C HamanoDec 16, 2021
  12. Junio C HamanoDec 16, 2021
  13. 3/4 add-patch: normalize format string of yes/no promptKashav Madan via GitGitGadget, Dec 16, 2021
  14. 4/4 help: make auto-correction prompt more consistentKashav Madan via GitGitGadget, Dec 16, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.