git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "kashav madan via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: kashav madan <kshvmdn@gmail.com>, Kashav Madan <kshvmdn@gmail.com>
Subject: [PATCH v2] help: make auto-correction prompt more consistent
Date: Wed, 15 Dec 2021 22:58:58 +0000	[thread overview]
Message-ID: <pull.1166.v2.git.git.1639609138813.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.1166.git.git.1639604468498.gitgitgadget@gmail.com>

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.

Signed-off-by: Kashav Madan <kshvmdn@gmail.com>
---
    help: make auto-correction prompt more consistent
    
    Changes since v1:
    
     * Appended (y/N) after the question mark
     * Enclosed the choices in (), not []

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1166%2Fkashav%2Fmaster-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1166/kashav/master-v2
Pull-Request: https://github.com/git/git/pull/1166

Range-diff vs v1:

 1:  5df696252dd ! 1:  e6dc616c964 help: add space after autocorrect prompt
     @@ Metadata
      Author: Kashav Madan <kshvmdn@gmail.com>
      
       ## Commit message ##
     -    help: add space after autocorrect prompt
     +    help: make auto-correction prompt more consistent
     +
     +    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.
      
          Signed-off-by: Kashav Madan <kshvmdn@gmail.com>
      
     @@ help.c: const char *help_unknown_cmd(const char *cmd)
       			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);
     ++			strbuf_addf(&msg, _("Run '%s' instead [y/N]? "), assumed);
       			answer = git_prompt(msg.buf, PROMPT_ECHO);
       			strbuf_release(&msg);
       			if (!(starts_with(answer, "y") ||


 help.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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
-- 
gitgitgadget

  parent reply	other threads:[~2021-12-15 22:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15 21:41 [PATCH] help: add space after autocorrect prompt kashav madan via GitGitGadget
2021-12-15 22:32 ` Junio C Hamano
2021-12-16  6:27   ` Johannes Altmanninger
2021-12-16 15:55     ` Eric Sunshine
2021-12-16 21:32     ` Junio C Hamano
2021-12-15 22:58 ` kashav madan via GitGitGadget [this message]
2021-12-16  3:12   ` [PATCH v2] help: make auto-correction prompt more consistent Junio C Hamano
2021-12-16 18:18   ` [PATCH v3 0/4] normalize format of yes/no prompts kashav madan via GitGitGadget
2021-12-16 18:18     ` [PATCH v3 1/4] bisect--helper: normalize format string " Kashav Madan via GitGitGadget
2021-12-16 21:39       ` Junio C Hamano
2021-12-16 21:49         ` Junio C Hamano
2021-12-16 18:18     ` [PATCH v3 2/4] clean: normalize format string of yes/no prompt Kashav Madan via GitGitGadget
2021-12-16 18:18     ` [PATCH v3 3/4] add-patch: " Kashav Madan via GitGitGadget
2021-12-16 18:18     ` [PATCH v3 4/4] help: make auto-correction prompt more consistent Kashav Madan via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.1166.v2.git.git.1639609138813.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kshvmdn@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).