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

Re: [PATCH v2] help: make auto-correction prompt more consistent

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 16, 2021, 03:12 UTC
Message-ID
<xmqq35mtz1i2.fsf@gitster.g>
In-Reply-To
<pull.1166.v2.git.git.1639609138813.gitgitgadget@gmail.com>
"kashav madan via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 6 quoted lines
> From: Kashav Madan <kshvmdn@gmail.com>
>
> There are three callsites of git_prompt() that ask the user for "yes/no"
> confirmation, but the one in help.c, used for auto-correction, is
> formatted differently from the others. This updates that format string
> to make the prompt look more consistent.
Looks much better.  

The last sentence should be phrased as if we were giving an order to the codebase to "become like so", to match the style, in which our log messages are typically written (look for "imperative-mood" in Documentation/SubmittingPatches).

Thanks.
Show 15 quoted lines
> diff --git a/help.c b/help.c
> index 973e47cdc30..71444906ddf 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") ||
>
> base-commit: e773545c7fe7eca21b134847f4fc2cbc9547fa14
Previous: kashav madan via GitGitGadgetNext: kashav madan via GitGitGadget
Message 7 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.