git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Keeping <john@keeping.me.uk>
To: Nikola Forrrr <nforro@redhat.com>
Cc: git@vger.kernel.org, gitster@pobox.com
Subject: Re: [PATCH] difftool/mergetool: make the form of yes/no questions consistent
Date: Tue, 12 Apr 2016 14:27:37 +0100	[thread overview]
Message-ID: <20160412132737.GB11013@serenity.lan> (raw)
In-Reply-To: <1460465982.3214.7.camel@redhat.com>

On Tue, Apr 12, 2016 at 02:59:42PM +0200, Nikola Forrrr wrote:
> Every yes/no question in difftool/mergetool scripts has slightly
> different form, and none of them is consistent with the form git
> itself uses.
> 
> Make the form of all the questions consistent with the form used
> by git, i.e. "Question [y/n]? ".
> 
> Signed-off-by: Nikola Forró <nforro@redhat.com>
> ---
>  git-difftool--helper.sh | 4 ++--
>  git-mergetool--lib.sh   | 2 +-
>  git-mergetool.sh        | 2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
> index 2b11b1d..84d6cc0 100755
> --- a/git-difftool--helper.sh
> +++ b/git-difftool--helper.sh
> @@ -44,10 +44,10 @@ launch_merge_tool () {
>  			"$GIT_DIFF_PATH_TOTAL" "$MERGED"
>  		if use_ext_cmd
>  		then
> -			printf "Launch '%s' [Y/n]: " \
> +			printf "Launch '%s' [Y/n]? " \
>  				"$GIT_DIFFTOOL_EXTCMD"
>  		else
> -			printf "Launch '%s' [Y/n]: " "$merge_tool"
> +			printf "Launch '%s' [Y/n]? " "$merge_tool"

I think the case in these two is correct as-is.  The "Y" is capitalised
because it is the default and will take effect if the user just presses
ENTER.

From a quick look, the two cases below do not have this behaviour (the
user must enter either "y" or "n"), so it is correct that they are not
capitalized.

The change from ":" to "?" and normalization of "?" placement below
seems reasonable.

>  		fi
>  		read ans || return
>  		if test "$ans" = n
> diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh
> index 54ac8e4..92adcc0 100644
> --- a/git-mergetool--lib.sh
> +++ b/git-mergetool--lib.sh
> @@ -100,7 +100,7 @@ check_unchanged () {
>  		while true
>  		do
>  			echo "$MERGED seems unchanged."
> -			printf "Was the merge successful? [y/n] "
> +			printf "Was the merge successful [y/n]? "
>  			read answer || return 1
>  			case "$answer" in
>  			y*|Y*) return 0 ;;
> diff --git a/git-mergetool.sh b/git-mergetool.sh
> index 9f77e3a..2e0635a 100755
> --- a/git-mergetool.sh
> +++ b/git-mergetool.sh
> @@ -396,7 +396,7 @@ done
>  prompt_after_failed_merge () {
>  	while true
>  	do
> -		printf "Continue merging other unresolved paths (y/n) ? "
> +		printf "Continue merging other unresolved paths [y/n]? "
>  		read ans || return 1
>  		case "$ans" in
>  		[yY]*)
> -- 
> 2.4.11

  reply	other threads:[~2016-04-12 13:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-12 12:59 [PATCH] difftool/mergetool: make the form of yes/no questions consistent Nikola Forró
2016-04-12 13:27 ` John Keeping [this message]
2016-04-12 13:53   ` Nikola Forró
2016-04-12 14:01     ` John Keeping
2016-04-12 18:05       ` David Aguilar
2016-04-12 16:15 ` Junio C Hamano

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=20160412132737.GB11013@serenity.lan \
    --to=john@keeping.me.uk \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=nforro@redhat.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).