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

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

 



From: Kashav Madan <kshvmdn@xxxxxxxxx>

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@xxxxxxxxx>
---
    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@xxxxxxxxx>
      
       ## 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@xxxxxxxxx>
      
     @@ 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



[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