@matheusbsbs / matheus-bagliano / commits / 61ed71dcff
Fork 0

difftool--helper: Remove use of the GIT_MERGE_TOOL variable

An undocumented mis-feature in git-difftool is that it allows you to specify a default difftool by setting GIT_MERGE_TOOL. This behavior was never documented and was included as an oversight back when git-difftool was maintained outside of git. git-mergetool never honored GIT_MERGE_TOOL so neither should git-difftool. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

David Aguilar committed Jan 9, 2010 at 20:02 UTC 61ed71dcff8448b0700ef032aa1f962649306624
2 files changed +4 -14
git-difftool--helper.sh
+4 -5
@@ -40,11 +40,10 @@ launch_merge_tool () {
40 run_merge_tool "$merge_tool"
41 }
42
43 -# Allow GIT_DIFF_TOOL and GIT_MERGE_TOOL to provide default values
44 -test -n "$GIT_MERGE_TOOL" && merge_tool="$GIT_MERGE_TOOL"
45 -test -n "$GIT_DIFF_TOOL" && merge_tool="$GIT_DIFF_TOOL"
46 -
47 -if test -z "$merge_tool"; then
43 +# GIT_DIFF_TOOL indicates that --tool=... was specified
44 +if test -n "$GIT_DIFF_TOOL"; then
45 + merge_tool="$GIT_DIFF_TOOL"
46 +else
47 merge_tool="$(get_merge_tool)" || exit
48 fi
49
t/t7800-difftool.sh
-9
@@ -32,7 +32,6 @@ restore_test_defaults()
32 # Restores the test defaults used by several tests
33 remove_config_vars
34 unset GIT_DIFF_TOOL
35 - unset GIT_MERGE_TOOL
35 unset GIT_DIFFTOOL_PROMPT
36 unset GIT_DIFFTOOL_NO_PROMPT
37 git config diff.tool test-tool &&
@@ -107,15 +106,7 @@ test_expect_success 'GIT_DIFF_TOOL overrides' '
106 git config diff.tool bogus-tool &&
107 git config merge.tool bogus-tool &&
108
110 - GIT_MERGE_TOOL=test-tool &&
111 - export GIT_MERGE_TOOL &&
112 - diff=$(git difftool --no-prompt branch) &&
113 - test "$diff" = "branch" &&
114 - unset GIT_MERGE_TOOL &&
115 -
116 - GIT_MERGE_TOOL=bogus-tool &&
109 GIT_DIFF_TOOL=test-tool &&
118 - export GIT_MERGE_TOOL &&
110 export GIT_DIFF_TOOL &&
111
112 diff=$(git difftool --no-prompt branch) &&