# [PATCH v2] difftool/mergetool: make the form of yes/no questions consistent

4 messages from 2016-04-12 to 2016-04-13. Participants: Nikola Forró, Junio C Hamano, David Aguilar.
Thread: https://gitlist.dev/t/42003

## Nikola Forró, 2016-04-12 14:44

Subject: [PATCH v2] difftool/mergetool: make the form of yes/no questions consistent
Message-ID: <1460472260.3214.23.camel@redhat.com>
URL: https://gitlist.dev/e/1460472260.3214.23.camel%40redhat.com

```
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.

Reviewed-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Nikola Forró <nforro@redhat.com>
---
Changes in v2: example dropped from the commit message

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

```

## Junio C Hamano, 2016-04-12 21:15

Subject: Re: [PATCH v2] difftool/mergetool: make the form of yes/no questions consistent
Message-ID: <xmqqegaapm02.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqegaapm02.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <1460472260.3214.23.camel@redhat.com>

```
Nikola Forró <nforro@redhat.com> writes:

> 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.
>
> Reviewed-by: John Keeping <john@keeping.me.uk>
> Signed-off-by: Nikola Forró <nforro@redhat.com>
> ---
> Changes in v2: example dropped from the commit message

Thanks; have you run the test suite with this patch applied?

It is your responsibility to make sure that the expectation by
existing tests are still satisfied after your change, or update
their expectation to match the new (and hopefully better) world
order your patch introduces.

I needed to squash this in to make the tests pass, but because I am
not a difftool user, I do not at all know if the prompt produced
(and expected by the test) is sensible or not.

 t/t7800-difftool.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index ec8bc8c..df9050f 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -20,7 +20,7 @@ difftool_test_setup ()
 prompt_given ()
 {
 	prompt="$1"
-	test "$prompt" = "Launch 'test-tool' [Y/n]: branch"
+	test "$prompt" = "Launch 'test-tool' [Y/n]? branch"
 }
 
 # Create a file on master and change it on branch

```

## David Aguilar, 2016-04-13 01:25

Subject: Re: [PATCH v2] difftool/mergetool: make the form of yes/no questions consistent
Message-ID: <20160413012501.GA32611@gmail.com>
URL: https://gitlist.dev/e/20160413012501.GA32611%40gmail.com
In-Reply-To: <xmqqegaapm02.fsf@gitster.mtv.corp.google.com>

```
On Tue, Apr 12, 2016 at 02:15:09PM -0700, Junio C Hamano wrote:
> Nikola Forró <nforro@redhat.com> writes:
> 
> > 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.
> >
> > Reviewed-by: John Keeping <john@keeping.me.uk>
> > Signed-off-by: Nikola Forró <nforro@redhat.com>
> > ---
> > Changes in v2: example dropped from the commit message
> 
> Thanks; have you run the test suite with this patch applied?
> 
> It is your responsibility to make sure that the expectation by
> existing tests are still satisfied after your change, or update
> their expectation to match the new (and hopefully better) world
> order your patch introduces.
> 
> I needed to squash this in to make the tests pass, but because I am
> not a difftool user, I do not at all know if the prompt produced
> (and expected by the test) is sensible or not.
> 
>  t/t7800-difftool.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
> index ec8bc8c..df9050f 100755
> --- a/t/t7800-difftool.sh
> +++ b/t/t7800-difftool.sh
> @@ -20,7 +20,7 @@ difftool_test_setup ()
>  prompt_given ()
>  {
>  	prompt="$1"
> -	test "$prompt" = "Launch 'test-tool' [Y/n]: branch"
> +	test "$prompt" = "Launch 'test-tool' [Y/n]? branch"
>  }
>  
>  # Create a file on master and change it on branch

That looks correct to me.  Sorry 'bout that, I'll remember to
run the tests with the patches applied next time.

cheers,
-- 
David

```

## Nikola Forró, 2016-04-13 10:27

Subject: Re: [PATCH v2] difftool/mergetool: make the form of yes/no questions consistent
Message-ID: <1460543255.3228.13.camel@redhat.com>
URL: https://gitlist.dev/e/1460543255.3228.13.camel%40redhat.com
In-Reply-To: <xmqqegaapm02.fsf@gitster.mtv.corp.google.com>

```
On Tue, 2016-04-12 at 14:15 -0700, Junio C Hamano wrote:
> Thanks; have you run the test suite with this patch applied?

Sorry, I totally forgot. I'll make sure to do that next time.

Thanks,
Nikola

```
