{"thread":{"id":"32916","subject":"[PATCH 1/4] difftool: silence uninitialized variable warning","startedAt":"2013-02-16T05:47:43Z","lastAt":"2013-02-17T11:23:34Z","messageCount":7,"participants":["David Aguilar","Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"209577","messageId":"1360993666-81308-1-git-send-email-davvid@gmail.com","threadId":"32916","inReplyTo":null,"subject":"[PATCH 1/4] difftool: silence uninitialized variable warning","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-02-16T05:47:43Z","receivedAt":"2013-02-16T05:47:43Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Git::config() returns `undef` when given keys that do not exist.\nCheck that the $guitool value is defined to prevent a noisy\n\"Use of uninitialized variable $guitool in length\" warning.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n git-difftool.perl | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-difftool.perl b/git-difftool.perl\nindex 0a90de4..12231fb 100755\n--- a/git-difftool.perl\n+++ b/git-difftool.perl\n@@ -336,7 +336,7 @@ sub main\n \t}\n \tif ($opts{gui}) {\n \t\tmy $guitool = Git::config('diff.guitool');\n-\t\tif (length($guitool) > 0) {\n+\t\tif (defined($guitool) && length($guitool) > 0) {\n \t\t\t$ENV{GIT_DIFF_TOOL} = $guitool;\n \t\t}\n \t}\n-- \n1.8.1.3.623.g622c8fc\n"},{"id":"209578","messageId":"1360993666-81308-2-git-send-email-davvid@gmail.com","threadId":"32916","inReplyTo":"1360993666-81308-1-git-send-email-davvid@gmail.com","subject":"[PATCH 2/4] t7800: Update copyright notice","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-02-16T05:47:44Z","receivedAt":"2013-02-16T05:47:44Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Signed-off-by: David Aguilar <davvid@gmail.com>\n---\n t/t7800-difftool.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex eb1d3f8..bb3158a 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -1,6 +1,6 @@\n #!/bin/sh\n #\n-# Copyright (c) 2009, 2010 David Aguilar\n+# Copyright (c) 2009, 2010, 2012 David Aguilar\n #\n \n test_description='git-difftool\n-- \n1.8.1.3.623.g622c8fc\n"},{"id":"209579","messageId":"1360993666-81308-3-git-send-email-davvid@gmail.com","threadId":"32916","inReplyTo":"1360993666-81308-2-git-send-email-davvid@gmail.com","subject":"[PATCH 3/4] t7800: modernize tests","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-02-16T05:47:45Z","receivedAt":"2013-02-16T05:47:45Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"Eliminate a lot of redundant work by using test_config().\nChain everything together by using sane_unset() and a\nsimpler difftool_test_setup().\n\nThe original tests relied upon restore_test_defaults()\nfrom the previous test to provide the next test with a sane\nenvironment.  Make the tests do their own setup so that they\nare not dependent on the success of the previous test.\nThe end result is shorter tests and better test isolation.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n t/t7800-difftool.sh | 160 +++++++++++++++++++++-------------------------------\n 1 file changed, 63 insertions(+), 97 deletions(-)\n\ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex bb3158a..2d1ba8d 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -10,29 +10,11 @@ Testing basic diff tool invocation\n \n . ./test-lib.sh\n \n-remove_config_vars()\n+difftool_test_setup()\n {\n-\t# Unset all config variables used by git-difftool\n-\tgit config --unset diff.tool\n-\tgit config --unset diff.guitool\n-\tgit config --unset difftool.test-tool.cmd\n-\tgit config --unset difftool.prompt\n-\tgit config --unset merge.tool\n-\tgit config --unset mergetool.test-tool.cmd\n-\tgit config --unset mergetool.prompt\n-\treturn 0\n-}\n-\n-restore_test_defaults()\n-{\n-\t# Restores the test defaults used by several tests\n-\tremove_config_vars\n-\tunset GIT_DIFF_TOOL\n-\tunset GIT_DIFFTOOL_PROMPT\n-\tunset GIT_DIFFTOOL_NO_PROMPT\n-\tgit config diff.tool test-tool &&\n-\tgit config difftool.test-tool.cmd 'cat $LOCAL'\n-\tgit config difftool.bogus-tool.cmd false\n+\ttest_config diff.tool test-tool &&\n+\ttest_config difftool.test-tool.cmd 'cat $LOCAL' &&\n+\ttest_config difftool.bogus-tool.cmd false\n }\n \n prompt_given()\n@@ -65,36 +47,33 @@ test_expect_success PERL 'setup' '\n \n # Configure a custom difftool.<tool>.cmd and use it\n test_expect_success PERL 'custom commands' '\n-\trestore_test_defaults &&\n-\tgit config difftool.test-tool.cmd \"cat \\$REMOTE\" &&\n-\n+\tdifftool_test_setup &&\n+\ttest_config difftool.test-tool.cmd \"cat \\$REMOTE\" &&\n \tdiff=$(git difftool --no-prompt branch) &&\n \ttest \"$diff\" = \"master\" &&\n \n-\trestore_test_defaults &&\n+\ttest_config difftool.test-tool.cmd \"cat \\$LOCAL\" &&\n \tdiff=$(git difftool --no-prompt branch) &&\n \ttest \"$diff\" = \"branch\"\n '\n \n # Ensures that a custom difftool.<tool>.cmd overrides built-ins\n test_expect_success PERL 'custom commands override built-ins' '\n-\trestore_test_defaults &&\n-\tgit config difftool.defaults.cmd \"cat \\$REMOTE\" &&\n+\ttest_config difftool.defaults.cmd \"cat \\$REMOTE\" &&\n \n \tdiff=$(git difftool --tool defaults --no-prompt branch) &&\n-\ttest \"$diff\" = \"master\" &&\n-\n-\tgit config --unset difftool.defaults.cmd\n+\ttest \"$diff\" = \"master\"\n '\n \n # Ensures that git-difftool ignores bogus --tool values\n test_expect_success PERL 'difftool ignores bad --tool values' '\n \tdiff=$(git difftool --no-prompt --tool=bad-tool branch)\n \ttest \"$?\" = 1 &&\n-\ttest \"$diff\" = \"\"\n+\ttest -z \"$diff\"\n '\n \n test_expect_success PERL 'difftool forwards arguments to diff' '\n+\tdifftool_test_setup &&\n \t>for-diff &&\n \tgit add for-diff &&\n \techo changes>for-diff &&\n@@ -106,178 +85,165 @@ test_expect_success PERL 'difftool forwards arguments to diff' '\n '\n \n test_expect_success PERL 'difftool honors --gui' '\n-\tgit config merge.tool bogus-tool &&\n-\tgit config diff.tool bogus-tool &&\n-\tgit config diff.guitool test-tool &&\n+\tdifftool_test_setup &&\n+\ttest_config merge.tool bogus-tool &&\n+\ttest_config diff.tool bogus-tool &&\n+\ttest_config diff.guitool test-tool &&\n \n \tdiff=$(git difftool --no-prompt --gui branch) &&\n-\ttest \"$diff\" = \"branch\" &&\n-\n-\trestore_test_defaults\n+\ttest \"$diff\" = \"branch\"\n '\n \n test_expect_success PERL 'difftool --gui last setting wins' '\n-\tgit config diff.guitool bogus-tool &&\n-\tgit difftool --no-prompt --gui --no-gui &&\n+\tdifftool_test_setup &&\n \n-\tgit config merge.tool bogus-tool &&\n-\tgit config diff.tool bogus-tool &&\n-\tgit config diff.guitool test-tool &&\n-\tdiff=$(git difftool --no-prompt --no-gui --gui branch) &&\n-\ttest \"$diff\" = \"branch\" &&\n+\tdiff=$(git difftool --no-prompt --gui --no-gui) &&\n+\ttest -z \"$diff\" &&\n \n-\trestore_test_defaults\n+\ttest_config merge.tool bogus-tool &&\n+\ttest_config diff.tool bogus-tool &&\n+\ttest_config diff.guitool test-tool &&\n+\n+\tdiff=$(git difftool --no-prompt --no-gui --gui branch) &&\n+\ttest \"$diff\" = \"branch\"\n '\n \n test_expect_success PERL 'difftool --gui works without configured diff.guitool' '\n-\tgit config diff.tool test-tool &&\n+\tdifftool_test_setup &&\n \n \tdiff=$(git difftool --no-prompt --gui branch) &&\n-\ttest \"$diff\" = \"branch\" &&\n-\n-\trestore_test_defaults\n+\ttest \"$diff\" = \"branch\"\n '\n \n # Specify the diff tool using $GIT_DIFF_TOOL\n test_expect_success PERL 'GIT_DIFF_TOOL variable' '\n-\ttest_might_fail git config --unset diff.tool &&\n+\tdifftool_test_setup &&\n+\tgit config --unset diff.tool &&\n+\n \tGIT_DIFF_TOOL=test-tool &&\n \texport GIT_DIFF_TOOL &&\n \n \tdiff=$(git difftool --no-prompt branch) &&\n \ttest \"$diff\" = \"branch\" &&\n-\n-\trestore_test_defaults\n+\tsane_unset GIT_DIFF_TOOL\n '\n \n # Test the $GIT_*_TOOL variables and ensure\n # that $GIT_DIFF_TOOL always wins unless --tool is specified\n test_expect_success PERL 'GIT_DIFF_TOOL overrides' '\n-\tgit config diff.tool bogus-tool &&\n-\tgit config merge.tool bogus-tool &&\n-\n+\tdifftool_test_setup &&\n+\ttest_config diff.tool bogus-tool &&\n+\ttest_config merge.tool bogus-tool &&\n \tGIT_DIFF_TOOL=test-tool &&\n \texport GIT_DIFF_TOOL &&\n \n \tdiff=$(git difftool --no-prompt branch) &&\n \ttest \"$diff\" = \"branch\" &&\n \n+\ttest_config diff.tool bogus-tool &&\n+\ttest_config merge.tool bogus-tool &&\n \tGIT_DIFF_TOOL=bogus-tool &&\n \texport GIT_DIFF_TOOL &&\n \n \tdiff=$(git difftool --no-prompt --tool=test-tool branch) &&\n \ttest \"$diff\" = \"branch\" &&\n-\n-\trestore_test_defaults\n+\tsane_unset GIT_DIFF_TOOL\n '\n \n # Test that we don't have to pass --no-prompt to difftool\n # when $GIT_DIFFTOOL_NO_PROMPT is true\n test_expect_success PERL 'GIT_DIFFTOOL_NO_PROMPT variable' '\n+\tdifftool_test_setup &&\n \tGIT_DIFFTOOL_NO_PROMPT=true &&\n \texport GIT_DIFFTOOL_NO_PROMPT &&\n \n \tdiff=$(git difftool branch) &&\n \ttest \"$diff\" = \"branch\" &&\n-\n-\trestore_test_defaults\n+\tsane_unset GIT_DIFFTOOL_NO_PROMPT\n '\n \n # git-difftool supports the difftool.prompt variable.\n # Test that GIT_DIFFTOOL_PROMPT can override difftool.prompt = false\n test_expect_success PERL 'GIT_DIFFTOOL_PROMPT variable' '\n-\tgit config difftool.prompt false &&\n+\tdifftool_test_setup &&\n+\ttest_config difftool.prompt false &&\n \tGIT_DIFFTOOL_PROMPT=true &&\n \texport GIT_DIFFTOOL_PROMPT &&\n \n \tprompt=$(echo | git difftool branch | tail -1) &&\n \tprompt_given \"$prompt\" &&\n-\n-\trestore_test_defaults\n+\tsane_unset GIT_DIFFTOOL_PROMPT\n '\n \n # Test that we don't have to pass --no-prompt when difftool.prompt is false\n test_expect_success PERL 'difftool.prompt config variable is false' '\n-\tgit config difftool.prompt false &&\n+\tdifftool_test_setup &&\n+\ttest_config difftool.prompt false &&\n \n \tdiff=$(git difftool branch) &&\n-\ttest \"$diff\" = \"branch\" &&\n-\n-\trestore_test_defaults\n+\ttest \"$diff\" = \"branch\"\n '\n \n # Test that we don't have to pass --no-prompt when mergetool.prompt is false\n test_expect_success PERL 'difftool merge.prompt = false' '\n+\tdifftool_test_setup &&\n \ttest_might_fail git config --unset difftool.prompt &&\n-\tgit config mergetool.prompt false &&\n+\ttest_config mergetool.prompt false &&\n \n \tdiff=$(git difftool branch) &&\n-\ttest \"$diff\" = \"branch\" &&\n-\n-\trestore_test_defaults\n+\ttest \"$diff\" = \"branch\"\n '\n \n # Test that the -y flag can override difftool.prompt = true\n test_expect_success PERL 'difftool.prompt can overridden with -y' '\n-\tgit config difftool.prompt true &&\n+\tdifftool_test_setup &&\n+\ttest_config difftool.prompt true &&\n \n \tdiff=$(git difftool -y branch) &&\n-\ttest \"$diff\" = \"branch\" &&\n-\n-\trestore_test_defaults\n+\ttest \"$diff\" = \"branch\"\n '\n \n # Test that the --prompt flag can override difftool.prompt = false\n test_expect_success PERL 'difftool.prompt can overridden with --prompt' '\n-\tgit config difftool.prompt false &&\n+\tdifftool_test_setup &&\n+\ttest_config difftool.prompt false &&\n \n \tprompt=$(echo | git difftool --prompt branch | tail -1) &&\n-\tprompt_given \"$prompt\" &&\n-\n-\trestore_test_defaults\n+\tprompt_given \"$prompt\"\n '\n \n # Test that the last flag passed on the command-line wins\n test_expect_success PERL 'difftool last flag wins' '\n+\tdifftool_test_setup &&\n \tdiff=$(git difftool --prompt --no-prompt branch) &&\n \ttest \"$diff\" = \"branch\" &&\n \n-\trestore_test_defaults &&\n-\n \tprompt=$(echo | git difftool --no-prompt --prompt branch | tail -1) &&\n-\tprompt_given \"$prompt\" &&\n-\n-\trestore_test_defaults\n+\tprompt_given \"$prompt\"\n '\n \n # git-difftool falls back to git-mergetool config variables\n # so test that behavior here\n test_expect_success PERL 'difftool + mergetool config variables' '\n-\tremove_config_vars &&\n-\tgit config merge.tool test-tool &&\n-\tgit config mergetool.test-tool.cmd \"cat \\$LOCAL\" &&\n+\ttest_config merge.tool test-tool &&\n+\ttest_config mergetool.test-tool.cmd \"cat \\$LOCAL\" &&\n \n \tdiff=$(git difftool --no-prompt branch) &&\n \ttest \"$diff\" = \"branch\" &&\n \n \t# set merge.tool to something bogus, diff.tool to test-tool\n-\tgit config merge.tool bogus-tool &&\n-\tgit config diff.tool test-tool &&\n+\ttest_config merge.tool bogus-tool &&\n+\ttest_config diff.tool test-tool &&\n \n \tdiff=$(git difftool --no-prompt branch) &&\n-\ttest \"$diff\" = \"branch\" &&\n-\n-\trestore_test_defaults\n+\ttest \"$diff\" = \"branch\"\n '\n \n test_expect_success PERL 'difftool.<tool>.path' '\n-\tgit config difftool.tkdiff.path echo &&\n+\ttest_config difftool.tkdiff.path echo &&\n \tdiff=$(git difftool --tool=tkdiff --no-prompt branch) &&\n-\tgit config --unset difftool.tkdiff.path &&\n \tlines=$(echo \"$diff\" | grep file | wc -l) &&\n-\ttest \"$lines\" -eq 1 &&\n-\n-\trestore_test_defaults\n+\ttest \"$lines\" -eq 1\n '\n \n test_expect_success PERL 'difftool --extcmd=cat' '\n-- \n1.8.1.3.623.g622c8fc\n"},{"id":"209580","messageId":"1360993666-81308-4-git-send-email-davvid@gmail.com","threadId":"32916","inReplyTo":"1360993666-81308-3-git-send-email-davvid@gmail.com","subject":"[PATCH 4/4] t7800: \"defaults\" is no longer a builtin tool name","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-02-16T05:47:46Z","receivedAt":"2013-02-16T05:47:46Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"073678b8e6324a155fa99f40eee0637941a70a34 reworked the\nmergetools/ directory so that every file corresponds to a\ndifftool-supported tool.  When this happened the \"defaults\"\nfile went away as it was no longer needed by mergetool--lib.\n\nt7800 tests that configured commands can override builtins,\nbut this test was not adjusted when the \"defaults\" file was\nremoved because the test continued to pass.\n\nAdjust the test to use the everlasting \"vimdiff\" tool name\ninstead of \"defaults\" so that it correctly tests against a tool\nthat is known by mergetool--lib.\n\nSigned-off-by: David Aguilar <davvid@gmail.com>\n---\n t/t7800-difftool.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\nindex 2d1ba8d..6307c36 100755\n--- a/t/t7800-difftool.sh\n+++ b/t/t7800-difftool.sh\n@@ -59,9 +59,9 @@ test_expect_success PERL 'custom commands' '\n \n # Ensures that a custom difftool.<tool>.cmd overrides built-ins\n test_expect_success PERL 'custom commands override built-ins' '\n-\ttest_config difftool.defaults.cmd \"cat \\$REMOTE\" &&\n+\ttest_config difftool.vimdiff.cmd \"cat \\$REMOTE\" &&\n \n-\tdiff=$(git difftool --tool defaults --no-prompt branch) &&\n+\tdiff=$(git difftool --tool vimdiff --no-prompt branch) &&\n \ttest \"$diff\" = \"master\"\n '\n \n-- \n1.8.1.3.623.g622c8fc\n"},{"id":"209581","messageId":"CAJDDKr7acMrki8r2KWfcjiwr+Naiq_GT53UOo0D42qecPF361g@mail.gmail.com","threadId":"32916","inReplyTo":"1360993666-81308-2-git-send-email-davvid@gmail.com","subject":"Re: [PATCH 2/4] t7800: Update copyright notice","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2013-02-16T06:35:17Z","receivedAt":"2013-02-16T06:35:17Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, Feb 15, 2013 at 9:47 PM, David Aguilar <davvid@gmail.com> wrote:\n> Signed-off-by: David Aguilar <davvid@gmail.com>\n> ---\n>  t/t7800-difftool.sh | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh\n> index eb1d3f8..bb3158a 100755\n> --- a/t/t7800-difftool.sh\n> +++ b/t/t7800-difftool.sh\n> @@ -1,6 +1,6 @@\n>  #!/bin/sh\n>  #\n> -# Copyright (c) 2009, 2010 David Aguilar\n> +# Copyright (c) 2009, 2010, 2012 David Aguilar\n\nOh boy, I'm still living in the past.\nThis should also include 2013.  It gets me every time! ;-)\n\nI'll wait and see if there are other review comments before I resend.\n-- \nDavid\n"},{"id":"209594","messageId":"20130217112139.GG6759@elie.Belkin","threadId":"32916","inReplyTo":"1360993666-81308-3-git-send-email-davvid@gmail.com","subject":"Re: [PATCH 3/4] t7800: modernize tests","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-02-17T11:21:40Z","receivedAt":"2013-02-17T11:21:40Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"David Aguilar wrote:\n\n> --- a/t/t7800-difftool.sh\n> +++ b/t/t7800-difftool.sh\n> @@ -10,29 +10,11 @@ Testing basic diff tool invocation\n[...]\n> -restore_test_defaults()\n> -{\n> -\t# Restores the test defaults used by several tests\n> -\tremove_config_vars\n> -\tunset GIT_DIFF_TOOL\n> -\tunset GIT_DIFFTOOL_PROMPT\n> -\tunset GIT_DIFFTOOL_NO_PROMPT\n> -\tgit config diff.tool test-tool &&\n> -\tgit config difftool.test-tool.cmd 'cat $LOCAL'\n> -\tgit config difftool.bogus-tool.cmd false\n\nYay. :)\n\n[...]\n>  # Ensures that git-difftool ignores bogus --tool values\n>  test_expect_success PERL 'difftool ignores bad --tool values' '\n>  \tdiff=$(git difftool --no-prompt --tool=bad-tool branch)\n>  \ttest \"$?\" = 1 &&\n> -\ttest \"$diff\" = \"\"\n> +\ttest -z \"$diff\"\n>  '\n\nNot about this patch: if I add more commands before that \"diff\",\ntheir exit status would be ignored.  Could this be made more resilient\nusing test_expect_code?  Something like\n\n\ttest_expect_code 1 git diff --no-prompt --tool=bad-tool branch >actual &&\n\t>expect &&\n\ttest_cmp expect actual\n\n[...]\n>  # Specify the diff tool using $GIT_DIFF_TOOL\n>  test_expect_success PERL 'GIT_DIFF_TOOL variable' '\n> -\ttest_might_fail git config --unset diff.tool &&\n> +\tdifftool_test_setup &&\n> +\tgit config --unset diff.tool &&\n> +\n>  \tGIT_DIFF_TOOL=test-tool &&\n>  \texport GIT_DIFF_TOOL &&\n>  \n>  \tdiff=$(git difftool --no-prompt branch) &&\n>  \ttest \"$diff\" = \"branch\" &&\n> -\n> -\trestore_test_defaults\n> +\tsane_unset GIT_DIFF_TOOL\n\nIf this test fails, GIT_DIFF_TOOL would remain set which could take\ndown later tests, too.  Could it be set in a subprocess (e.g., a\nsubshell) to avoid that?\n\n\tdifftool_test_setup &&\n\tgit config --unset diff.tool &&\n\n\techo branch >expect &&\n\tGIT_DIFF_TOOL=test-tool git difftool --no-prompt branch >actual &&\n\ttest_cmp expect actual\n\n[...]\n>  test_expect_success PERL 'GIT_DIFF_TOOL overrides' '\n> -\tgit config diff.tool bogus-tool &&\n> -\tgit config merge.tool bogus-tool &&\n> -\n> +\tdifftool_test_setup &&\n> +\ttest_config diff.tool bogus-tool &&\n> +\ttest_config merge.tool bogus-tool &&\n>  \tGIT_DIFF_TOOL=test-tool &&\n>  \texport GIT_DIFF_TOOL &&\n>  \n>  \tdiff=$(git difftool --no-prompt branch) &&\n\nLikewise.\n\n[...]\n>  \tGIT_DIFF_TOOL=bogus-tool &&\n>  \texport GIT_DIFF_TOOL &&\n>  \n>  \tdiff=$(git difftool --no-prompt --tool=test-tool branch) &&\n\nLikewise.\n\n[...]\n>  test_expect_success PERL 'GIT_DIFFTOOL_NO_PROMPT variable' '\n> +\tdifftool_test_setup &&\n>  \tGIT_DIFFTOOL_NO_PROMPT=true &&\n>  \texport GIT_DIFFTOOL_NO_PROMPT &&\n>  \n>  \tdiff=$(git difftool branch) &&\n\nLikewise.\n\n[...]\n>  test_expect_success PERL 'GIT_DIFFTOOL_PROMPT variable' '\n> -\tgit config difftool.prompt false &&\n> +\tdifftool_test_setup &&\n> +\ttest_config difftool.prompt false &&\n>  \tGIT_DIFFTOOL_PROMPT=true &&\n>  \texport GIT_DIFFTOOL_PROMPT &&\n>  \n>  \tprompt=$(echo | git difftool branch | tail -1) &&\n\nLikewise.  This one loses the exit status from 'git difftool',\nwhich could be avoided by writing to temporary files:\n\n\techo >input &&\n\tGIT_DIFFTOOL_PROMPT=true git difftool branch <input >output &&\n\tprompt=$(tail -1 <output) &&\n\n[...]\n>  test_expect_success PERL 'difftool last flag wins' '\n> +\tdifftool_test_setup &&\n>  \tdiff=$(git difftool --prompt --no-prompt branch) &&\n>  \ttest \"$diff\" = \"branch\" &&\n>  \n> -\trestore_test_defaults &&\n> -\n>  \tprompt=$(echo | git difftool --no-prompt --prompt branch | tail -1) &&\n[...]\n\nLikewise.\n\nThanks for cleaning up, and sorry I don't have anything more\nsubstantial to offer.\n\nHope that helps,\nJonathan\n"},{"id":"209595","messageId":"20130217112334.GH6759@elie.Belkin","threadId":"32916","inReplyTo":"1360993666-81308-4-git-send-email-davvid@gmail.com","subject":"Re: [PATCH 4/4] t7800: \"defaults\" is no longer a builtin tool name","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-02-17T11:23:34Z","receivedAt":"2013-02-17T11:23:34Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"David Aguilar wrote:\n\n> t7800 tests that configured commands can override builtins,\n> but this test was not adjusted when the \"defaults\" file was\n> removed because the test continued to pass.\n>\n> Adjust the test to use the everlasting \"vimdiff\"\n\nHeh. :)\n\n>                                                  tool name\n> instead of \"defaults\" so that it correctly tests against a tool\n> that is known by mergetool--lib.\n\nMakes sense.  Thanks for a pleasant read.\n\nGood night,\nJonathan\n"}]}