git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "kashav madan via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, kashav madan <kshvmdn@gmail.com>
Subject: Re: [PATCH] help: add space after autocorrect prompt
Date: Wed, 15 Dec 2021 14:32:36 -0800	[thread overview]
Message-ID: <xmqqh7b933ej.fsf@gitster.g> (raw)
In-Reply-To: <pull.1166.git.git.1639604468498.gitgitgadget@gmail.com> (kashav madan via GitGitGadget's message of "Wed, 15 Dec 2021 21:41:08 +0000")

"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;
 - It encloses the choices in (), not [].

You are only addressing the first inconsistency, leaving the other
two still there.

So, perhaps you would want to explain the change this way

    Subject: [PATCH] help: update auto-correction prompt to look more like others

    There are three callsite of git_prompt() helper function to 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 others.  Update the format string to
    make the prompt string look more consistent.


And you'd want to update the string more like so:

> -			strbuf_addf(&msg, _("Run '%s' instead? (y/N)"), assumed);
> +			strbuf_addf(&msg, _("Run '%s' instead [y/N]? "), assumed);

to fix all three points, not just one.

Thanks.

  reply	other threads:[~2021-12-15 22:32 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 [this message]
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 ` [PATCH v2] help: make auto-correction prompt more consistent kashav madan via GitGitGadget
2021-12-16  3:12   ` 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqqh7b933ej.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).