* difftool--helper: exit when reading a prompt answer fails
@ 2014-10-26 8:09 Johannes Sixt
2014-10-27 0:41 ` David Aguilar
2014-10-27 1:15 ` [PATCH v3 1/2] t7800-difftool: use "test_must_fail grep" instead of "! grep" David Aguilar
0 siblings, 2 replies; 9+ messages in thread
From: Johannes Sixt @ 2014-10-26 8:09 UTC (permalink / raw)
To: David Aguilar; +Cc: Git Mailing List, Sitaram Chamarty
An attempt to quit difftool by hitting Ctrl-D (EOF) at its prompt does
not quit it, but is treated as if 'yes' was answered to the prompt and
all following prompts, which is contrary to the user's intent. Fix the
error check.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
---
Found while reviewing your latest patch.
I chose the 'foo || return' idiom for the error check, but left the
'if' for the interesting check, because I feel it is more readable
than 'test ... && return'.
-- Hannes
git-difftool--helper.sh | 3 ++-
t/t7800-difftool.sh | 8 ++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 7ef36b9..aca0413 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -49,7 +49,8 @@ launch_merge_tool () {
else
printf "Launch '%s' [Y/n]: " "$merge_tool"
fi
- if read ans && test "$ans" = n
+ read ans || return
+ if test "$ans" = n
then
return
fi
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index dc30a51..9cf5dc9 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -301,6 +301,14 @@ test_expect_success PERL 'say no to the second file' '
! grep br2 output
'
+test_expect_success PERL 'ending prompt input with EOF' '
+ git difftool -x cat branch </dev/null >output &&
+ ! grep master output &&
+ ! grep branch output &&
+ ! grep m2 output &&
+ ! grep br2 output
+'
+
test_expect_success PERL 'difftool --tool-help' '
git difftool --tool-help >output &&
grep tool output
--
2.0.0.12.gbcf935e
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: difftool--helper: exit when reading a prompt answer fails
2014-10-26 8:09 difftool--helper: exit when reading a prompt answer fails Johannes Sixt
@ 2014-10-27 0:41 ` David Aguilar
2014-10-27 1:10 ` David Aguilar
2014-10-27 17:38 ` Junio C Hamano
2014-10-27 1:15 ` [PATCH v3 1/2] t7800-difftool: use "test_must_fail grep" instead of "! grep" David Aguilar
1 sibling, 2 replies; 9+ messages in thread
From: David Aguilar @ 2014-10-27 0:41 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Git Mailing List, Sitaram Chamarty
On Sun, Oct 26, 2014 at 09:09:20AM +0100, Johannes Sixt wrote:
> An attempt to quit difftool by hitting Ctrl-D (EOF) at its prompt does
> not quit it, but is treated as if 'yes' was answered to the prompt and
> all following prompts, which is contrary to the user's intent. Fix the
> error check.
>
> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> ---
> Found while reviewing your latest patch.
Thanks for the careful review.
I have one small question about the test below.
I'll base the reroll of my patch on top of this one so that
I'm including your new test while developing.
Junio, can you please queue this patch before my upcoming v3
patch when I reroll?
I also noticed that I forgot to "git reset --hard" after doing "git add"
in one of the tests I introduced so I'll be adjusting that as well in v3.
> I chose the 'foo || return' idiom for the error check, but left the
> 'if' for the interesting check, because I feel it is more readable
> than 'test ... && return'.
>
> -- Hannes
>
> git-difftool--helper.sh | 3 ++-
> t/t7800-difftool.sh | 8 ++++++++
> 2 files changed, 10 insertions(+), 1 deletion(-)
>
> diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
> index 7ef36b9..aca0413 100755
> --- a/git-difftool--helper.sh
> +++ b/git-difftool--helper.sh
> @@ -49,7 +49,8 @@ launch_merge_tool () {
> else
> printf "Launch '%s' [Y/n]: " "$merge_tool"
> fi
> - if read ans && test "$ans" = n
> + read ans || return
> + if test "$ans" = n
> then
> return
> fi
> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
> index dc30a51..9cf5dc9 100755
> --- a/t/t7800-difftool.sh
> +++ b/t/t7800-difftool.sh
> @@ -301,6 +301,14 @@ test_expect_success PERL 'say no to the second file' '
> ! grep br2 output
> '
>
> +test_expect_success PERL 'ending prompt input with EOF' '
> + git difftool -x cat branch </dev/null >output &&
> + ! grep master output &&
> + ! grep branch output &&
> + ! grep m2 output &&
> + ! grep br2 output
> +'
Should we use "test_must_fail grep ..." instead of "! grep ..." here?
--
David
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: difftool--helper: exit when reading a prompt answer fails
2014-10-27 0:41 ` David Aguilar
@ 2014-10-27 1:10 ` David Aguilar
2014-10-27 12:54 ` Michael J Gruber
2014-10-27 17:38 ` Junio C Hamano
1 sibling, 1 reply; 9+ messages in thread
From: David Aguilar @ 2014-10-27 1:10 UTC (permalink / raw)
To: Johannes Sixt; +Cc: Git Mailing List, Sitaram Chamarty
On Sun, Oct 26, 2014 at 05:41:49PM -0700, David Aguilar wrote:
> On Sun, Oct 26, 2014 at 09:09:20AM +0100, Johannes Sixt wrote:
> > An attempt to quit difftool by hitting Ctrl-D (EOF) at its prompt does
> > not quit it, but is treated as if 'yes' was answered to the prompt and
> > all following prompts, which is contrary to the user's intent. Fix the
> > error check.
> >
> > Signed-off-by: Johannes Sixt <j6t@kdbg.org>
> > ---
> > Found while reviewing your latest patch.
>
>
> Thanks for the careful review.
> I have one small question about the test below.
[snip]
> > diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
> > index dc30a51..9cf5dc9 100755
> > --- a/t/t7800-difftool.sh
> > +++ b/t/t7800-difftool.sh
> > @@ -301,6 +301,14 @@ test_expect_success PERL 'say no to the second file' '
> > ! grep br2 output
> > '
> >
> > +test_expect_success PERL 'ending prompt input with EOF' '
> > + git difftool -x cat branch </dev/null >output &&
> > + ! grep master output &&
> > + ! grep branch output &&
> > + ! grep m2 output &&
> > + ! grep br2 output
> > +'
>
> Should we use "test_must_fail grep ..." instead of "! grep ..." here?
Nevermind, this is good as-is.
Using "! grep" is consistent with the rest of the tests in t7800.
What I'll do is add a follow-up patch in my upcoming reroll
that swaps all the "! grep" lines to "test_must_fail grep"
in one step.
--
David
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v3 1/2] t7800-difftool: use "test_must_fail grep" instead of "! grep"
2014-10-26 8:09 difftool--helper: exit when reading a prompt answer fails Johannes Sixt
2014-10-27 0:41 ` David Aguilar
@ 2014-10-27 1:15 ` David Aguilar
2014-10-27 1:15 ` [PATCH v3 2/2] difftool: add support for --trust-exit-code David Aguilar
1 sibling, 1 reply; 9+ messages in thread
From: David Aguilar @ 2014-10-27 1:15 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Adri Farr, Johannes Sixt, Sitaram Chamarty
Signed-off-by: David Aguilar <davvid@gmail.com>
---
This patch is new since v2.
This series now depends on "difftool--helper: exit when reading a prompt answer fails".
t/t7800-difftool.sh | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 9cf5dc9..b5b7f62 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -288,8 +288,8 @@ test_expect_success PERL 'say no to the first file' '
git difftool -x cat branch <input >output &&
grep m2 output &&
grep br2 output &&
- ! grep master output &&
- ! grep branch output
+ test_must_fail grep master output &&
+ test_must_fail grep branch output
'
test_expect_success PERL 'say no to the second file' '
@@ -297,16 +297,16 @@ test_expect_success PERL 'say no to the second file' '
git difftool -x cat branch <input >output &&
grep master output &&
grep branch output &&
- ! grep m2 output &&
- ! grep br2 output
+ test_must_fail grep m2 output &&
+ test_must_fail grep br2 output
'
test_expect_success PERL 'ending prompt input with EOF' '
git difftool -x cat branch </dev/null >output &&
- ! grep master output &&
- ! grep branch output &&
- ! grep m2 output &&
- ! grep br2 output
+ test_must_fail grep master output &&
+ test_must_fail grep branch output &&
+ test_must_fail grep m2 output &&
+ test_must_fail grep br2 output
'
test_expect_success PERL 'difftool --tool-help' '
--
2.1.2.557.g1025af0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v3 2/2] difftool: add support for --trust-exit-code
2014-10-27 1:15 ` [PATCH v3 1/2] t7800-difftool: use "test_must_fail grep" instead of "! grep" David Aguilar
@ 2014-10-27 1:15 ` David Aguilar
2014-10-27 18:45 ` Junio C Hamano
0 siblings, 1 reply; 9+ messages in thread
From: David Aguilar @ 2014-10-27 1:15 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Adri Farr, Johannes Sixt, Sitaram Chamarty
Teach difftool to exit when a diff tool returns a non-zero exit
code when either --trust-exit-code is specified or
difftool.trustExitCode is true.
Forward exit codes from invoked diff tools to the caller when
--trust-exit-code is used.
Suggested-by: Adri Farr <14farresa@gmail.com>
Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: David Aguilar <davvid@gmail.com>
---
Changes since v2:
This series now depends on "difftool--helper: exit when reading a prompt answer fails".
A missing "git reset -- for-diff" was missing from the test.
Setting and testing of the status variable was moved to be
before "shift 7" to make things more cohesive; status setting
was previously buried inside the launch_merge_tool function,
which made it harder to follow.
Documentation/git-difftool.txt | 14 ++++++++++++++
git-difftool--helper.sh | 6 ++++++
git-difftool.perl | 12 ++++++++++++
t/t7800-difftool.sh | 44 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 76 insertions(+)
diff --git a/Documentation/git-difftool.txt b/Documentation/git-difftool.txt
index 11887e6..333cf6f 100644
--- a/Documentation/git-difftool.txt
+++ b/Documentation/git-difftool.txt
@@ -91,6 +91,15 @@ instead. `--no-symlinks` is the default on Windows.
the default diff tool will be read from the configured
`diff.guitool` variable instead of `diff.tool`.
+--[no-]trust-exit-code::
+ 'git-difftool' invokes a diff tool individually on each file.
+ Errors reported by the diff tool are ignored by default.
+ Use `--trust-exit-code` to make 'git-difftool' exit when an
+ invoked diff tool returns a non-zero exit code.
++
+'git-difftool' will forward the exit code of the invoked tool when
+'--trust-exit-code' is used.
+
See linkgit:git-diff[1] for the full list of supported options.
CONFIG VARIABLES
@@ -116,6 +125,11 @@ See the `--tool=<tool>` option above for more details.
difftool.prompt::
Prompt before each invocation of the diff tool.
+difftool.trustExitCode::
+ Exit difftool if the invoked diff tool returns a non-zero exit status.
++
+See the `--trust-exit-code` option above for more details.
+
SEE ALSO
--------
linkgit:git-diff[1]::
diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index aca0413..d4fb6df 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -85,6 +85,12 @@ else
while test $# -gt 6
do
launch_merge_tool "$1" "$2" "$5"
+ status=$?
+ if test "$status" != 0 &&
+ test "$GIT_DIFFTOOL_TRUST_EXIT_CODE" = true
+ then
+ exit $status
+ fi
shift 7
done
fi
diff --git a/git-difftool.perl b/git-difftool.perl
index 598fcc2..7df7c8a 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -342,6 +342,7 @@ sub main
symlinks => $^O ne 'cygwin' &&
$^O ne 'MSWin32' && $^O ne 'msys',
tool_help => undef,
+ trust_exit_code => undef,
);
GetOptions('g|gui!' => \$opts{gui},
'd|dir-diff' => \$opts{dirdiff},
@@ -352,6 +353,8 @@ sub main
'no-symlinks' => sub { $opts{symlinks} = 0; },
't|tool:s' => \$opts{difftool_cmd},
'tool-help' => \$opts{tool_help},
+ 'trust-exit-code' => \$opts{trust_exit_code},
+ 'no-trust-exit-code' => sub { $opts{trust_exit_code} = 0; },
'x|extcmd:s' => \$opts{extcmd});
if (defined($opts{help})) {
@@ -383,6 +386,15 @@ sub main
}
}
+ if (!defined $opts{trust_exit_code}) {
+ $opts{trust_exit_code} = Git::config_bool('difftool.trustExitCode');
+ }
+ if ($opts{trust_exit_code}) {
+ $ENV{GIT_DIFFTOOL_TRUST_EXIT_CODE} = 'true';
+ } else {
+ $ENV{GIT_DIFFTOOL_TRUST_EXIT_CODE} = 'false';
+ }
+
# In directory diff mode, 'git-difftool--helper' is called once
# to compare the a/b directories. In file diff mode, 'git diff'
# will invoke a separate instance of 'git-difftool--helper' for
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index b5b7f62..7de18dd 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -76,6 +76,50 @@ test_expect_success PERL 'difftool forwards arguments to diff' '
rm for-diff
'
+test_expect_success PERL 'difftool ignores exit code' '
+ test_config difftool.error.cmd false &&
+ git difftool -y -t error branch
+'
+
+test_expect_success PERL 'difftool forwards exit code with --trust-exit-code' '
+ test_config difftool.error.cmd false &&
+ test_must_fail git difftool -y --trust-exit-code -t error branch
+'
+
+test_expect_success PERL 'difftool honors difftool.trustExitCode = true' '
+ test_config difftool.error.cmd false &&
+ test_config difftool.trustExitCode true &&
+ test_must_fail git difftool -y -t error branch
+'
+
+test_expect_success PERL 'difftool honors difftool.trustExitCode = false' '
+ test_config difftool.error.cmd false &&
+ test_config difftool.trustExitCode false &&
+ git difftool -y -t error branch
+'
+
+test_expect_success PERL 'difftool ignores exit code with --no-trust-exit-code' '
+ test_config difftool.error.cmd false &&
+ test_config difftool.trustExitCode true &&
+ git difftool -y --no-trust-exit-code -t error branch
+'
+
+write_script .git/fail-right-file <<\EOF
+echo "$2"
+exit 1
+EOF
+
+test_expect_success PERL 'difftool stops on error with --trust-exit-code' '
+ >for-diff &&
+ git add for-diff &&
+ echo file>expect &&
+ test_must_fail git difftool -y --trust-exit-code \
+ --extcmd .git/fail-right-file branch >actual &&
+ test_cmp expect actual &&
+ git reset -- for-diff &&
+ rm -f for-diff .git/fail-right-file
+'
+
test_expect_success PERL 'difftool honors --gui' '
difftool_test_setup &&
test_config merge.tool bogus-tool &&
--
2.1.2.557.g1025af0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: difftool--helper: exit when reading a prompt answer fails
2014-10-27 1:10 ` David Aguilar
@ 2014-10-27 12:54 ` Michael J Gruber
0 siblings, 0 replies; 9+ messages in thread
From: Michael J Gruber @ 2014-10-27 12:54 UTC (permalink / raw)
To: David Aguilar, Johannes Sixt; +Cc: Git Mailing List, Sitaram Chamarty
David Aguilar schrieb am 27.10.2014 um 02:10:
> On Sun, Oct 26, 2014 at 05:41:49PM -0700, David Aguilar wrote:
>> On Sun, Oct 26, 2014 at 09:09:20AM +0100, Johannes Sixt wrote:
>>> An attempt to quit difftool by hitting Ctrl-D (EOF) at its prompt does
>>> not quit it, but is treated as if 'yes' was answered to the prompt and
>>> all following prompts, which is contrary to the user's intent. Fix the
>>> error check.
>>>
>>> Signed-off-by: Johannes Sixt <j6t@kdbg.org>
>>> ---
>>> Found while reviewing your latest patch.
>>
>>
>> Thanks for the careful review.
>> I have one small question about the test below.
>
> [snip]
>
>>> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
>>> index dc30a51..9cf5dc9 100755
>>> --- a/t/t7800-difftool.sh
>>> +++ b/t/t7800-difftool.sh
>>> @@ -301,6 +301,14 @@ test_expect_success PERL 'say no to the second file' '
>>> ! grep br2 output
>>> '
>>>
>>> +test_expect_success PERL 'ending prompt input with EOF' '
>>> + git difftool -x cat branch </dev/null >output &&
>>> + ! grep master output &&
>>> + ! grep branch output &&
>>> + ! grep m2 output &&
>>> + ! grep br2 output
>>> +'
>>
>> Should we use "test_must_fail grep ..." instead of "! grep ..." here?
>
>
> Nevermind, this is good as-is.
> Using "! grep" is consistent with the rest of the tests in t7800.
>
> What I'll do is add a follow-up patch in my upcoming reroll
> that swaps all the "! grep" lines to "test_must_fail grep"
> in one step.
Don't do that ;)
test_must_fail is meant for testing (git) commands such that a "failure
return code" is marked as "success", whereas a failure to run the
command is still capturd and marked as a failed test.
For non-git commands like grep sed etc. which we do not perform tests
*on* (but only *with*), the simple negator "!" is fine and preferable.
Michael who has sinned in the past, but repented
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: difftool--helper: exit when reading a prompt answer fails
2014-10-27 0:41 ` David Aguilar
2014-10-27 1:10 ` David Aguilar
@ 2014-10-27 17:38 ` Junio C Hamano
1 sibling, 0 replies; 9+ messages in thread
From: Junio C Hamano @ 2014-10-27 17:38 UTC (permalink / raw)
To: David Aguilar; +Cc: Johannes Sixt, Git Mailing List, Sitaram Chamarty
David Aguilar <davvid@gmail.com> writes:
>> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
>> index dc30a51..9cf5dc9 100755
>> --- a/t/t7800-difftool.sh
>> +++ b/t/t7800-difftool.sh
>> @@ -301,6 +301,14 @@ test_expect_success PERL 'say no to the second file' '
>> ! grep br2 output
>> '
>>
>> +test_expect_success PERL 'ending prompt input with EOF' '
>> + git difftool -x cat branch </dev/null >output &&
>> + ! grep master output &&
>> + ! grep branch output &&
>> + ! grep m2 output &&
>> + ! grep br2 output
>> +'
>
> Should we use "test_must_fail grep ..." instead of "! grep ..." here?
NO. We do not expect system-supplied "grep" to dump core and
declare it as a test failure. test_must_fail is for catching an
expected non-zero status exit from git commands, i.e. when we expect
our binary to correctly notice some condition and report that fact
with non-zero exit status, we do not want to mistake the binary
segfaulting as working correctly.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v3 2/2] difftool: add support for --trust-exit-code
2014-10-27 1:15 ` [PATCH v3 2/2] difftool: add support for --trust-exit-code David Aguilar
@ 2014-10-27 18:45 ` Junio C Hamano
2014-10-28 9:34 ` David Aguilar
0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2014-10-27 18:45 UTC (permalink / raw)
To: David Aguilar; +Cc: git, Adri Farr, Johannes Sixt, Sitaram Chamarty
David Aguilar <davvid@gmail.com> writes:
> +write_script .git/fail-right-file <<\EOF
> +echo "$2"
> +exit 1
> +EOF
This should be inside the next one, no?
> +test_expect_success PERL 'difftool stops on error with --trust-exit-code' '
> + >for-diff &&
> + git add for-diff &&
> + echo file>expect &&
> + test_must_fail git difftool -y --trust-exit-code \
> + --extcmd .git/fail-right-file branch >actual &&
> + test_cmp expect actual &&
> + git reset -- for-diff &&
> + rm -f for-diff .git/fail-right-file
> +'
In other words, this squashed in.
t/t7800-difftool.sh | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 4b2f611..69bde7a 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -104,20 +104,19 @@ test_expect_success PERL 'difftool ignores exit code with --no-trust-exit-code'
git difftool -y --no-trust-exit-code -t error branch
'
-write_script .git/fail-right-file <<\EOF
-echo "$2"
-exit 1
-EOF
-
test_expect_success PERL 'difftool stops on error with --trust-exit-code' '
+ test_when_finished "rm -f for-diff .git/fail-right-file" &&
+ test_when_finished "git reset -- for-diff" &&
+ write_script .git/fail-right-file <<-\EOF &&
+ echo "$2"
+ exit 1
+ EOF
>for-diff &&
git add for-diff &&
- echo file>expect &&
+ echo file >expect &&
test_must_fail git difftool -y --trust-exit-code \
--extcmd .git/fail-right-file branch >actual &&
- test_cmp expect actual &&
- git reset -- for-diff &&
- rm -f for-diff .git/fail-right-file
+ test_cmp expect actual
'
test_expect_success PERL 'difftool honors --gui' '
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH v3 2/2] difftool: add support for --trust-exit-code
2014-10-27 18:45 ` Junio C Hamano
@ 2014-10-28 9:34 ` David Aguilar
0 siblings, 0 replies; 9+ messages in thread
From: David Aguilar @ 2014-10-28 9:34 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Adri Farr, Johannes Sixt, Sitaram Chamarty
On Mon, Oct 27, 2014 at 11:45:14AM -0700, Junio C Hamano wrote:
> David Aguilar <davvid@gmail.com> writes:
>
> > +write_script .git/fail-right-file <<\EOF
> > +echo "$2"
> > +exit 1
> > +EOF
>
> This should be inside the next one, no?
>
> > +test_expect_success PERL 'difftool stops on error with --trust-exit-code' '
> > + >for-diff &&
> > + git add for-diff &&
> > + echo file>expect &&
> > + test_must_fail git difftool -y --trust-exit-code \
> > + --extcmd .git/fail-right-file branch >actual &&
> > + test_cmp expect actual &&
> > + git reset -- for-diff &&
> > + rm -f for-diff .git/fail-right-file
> > +'
>
> In other words, this squashed in.
Yes, please. And drop patch 1/2, of course.
Thanks for the clarification.
>
> t/t7800-difftool.sh | 17 ++++++++---------
> 1 file changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
> index 4b2f611..69bde7a 100755
> --- a/t/t7800-difftool.sh
> +++ b/t/t7800-difftool.sh
> @@ -104,20 +104,19 @@ test_expect_success PERL 'difftool ignores exit code with --no-trust-exit-code'
> git difftool -y --no-trust-exit-code -t error branch
> '
>
> -write_script .git/fail-right-file <<\EOF
> -echo "$2"
> -exit 1
> -EOF
> -
> test_expect_success PERL 'difftool stops on error with --trust-exit-code' '
> + test_when_finished "rm -f for-diff .git/fail-right-file" &&
> + test_when_finished "git reset -- for-diff" &&
> + write_script .git/fail-right-file <<-\EOF &&
> + echo "$2"
> + exit 1
> + EOF
> >for-diff &&
> git add for-diff &&
> - echo file>expect &&
> + echo file >expect &&
> test_must_fail git difftool -y --trust-exit-code \
> --extcmd .git/fail-right-file branch >actual &&
> - test_cmp expect actual &&
> - git reset -- for-diff &&
> - rm -f for-diff .git/fail-right-file
> + test_cmp expect actual
> '
>
> test_expect_success PERL 'difftool honors --gui' '
--
David
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-10-28 9:33 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-26 8:09 difftool--helper: exit when reading a prompt answer fails Johannes Sixt
2014-10-27 0:41 ` David Aguilar
2014-10-27 1:10 ` David Aguilar
2014-10-27 12:54 ` Michael J Gruber
2014-10-27 17:38 ` Junio C Hamano
2014-10-27 1:15 ` [PATCH v3 1/2] t7800-difftool: use "test_must_fail grep" instead of "! grep" David Aguilar
2014-10-27 1:15 ` [PATCH v3 2/2] difftool: add support for --trust-exit-code David Aguilar
2014-10-27 18:45 ` Junio C Hamano
2014-10-28 9:34 ` David Aguilar
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).