summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: db36713)
raw | patch | inline | side by side (parent: db36713)
author | David Aguilar <davvid@gmail.com> | |
Sun, 10 Jan 2010 04:02:41 +0000 (20:02 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 10 Jan 2010 06:41:29 +0000 (22:41 -0800) |
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>
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>
git-difftool--helper.sh | patch | blob | history | |
t/t7800-difftool.sh | patch | blob | history |
index 1b138083d3642af596fe56a74c4f98321e6135fc..3621f28c7969b7848e3fbcac49647f32028f18e7 100755 (executable)
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
run_merge_tool "$merge_tool"
}
-# Allow GIT_DIFF_TOOL and GIT_MERGE_TOOL to provide default values
-test -n "$GIT_MERGE_TOOL" && merge_tool="$GIT_MERGE_TOOL"
-test -n "$GIT_DIFF_TOOL" && merge_tool="$GIT_DIFF_TOOL"
-
-if test -z "$merge_tool"; then
+# GIT_DIFF_TOOL indicates that --tool=... was specified
+if test -n "$GIT_DIFF_TOOL"; then
+ merge_tool="$GIT_DIFF_TOOL"
+else
merge_tool="$(get_merge_tool)" || exit
fi
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 9bf6c98c54f368dfc837a8c5c374021269f20707..eca51a8fe8090e22f49b3c983a95fe1388be4584 100755 (executable)
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
# Restores the test defaults used by several tests
remove_config_vars
unset GIT_DIFF_TOOL
- unset GIT_MERGE_TOOL
unset GIT_DIFFTOOL_PROMPT
unset GIT_DIFFTOOL_NO_PROMPT
git config diff.tool test-tool &&
git config diff.tool bogus-tool &&
git config merge.tool bogus-tool &&
- GIT_MERGE_TOOL=test-tool &&
- export GIT_MERGE_TOOL &&
- diff=$(git difftool --no-prompt branch) &&
- test "$diff" = "branch" &&
- unset GIT_MERGE_TOOL &&
-
- GIT_MERGE_TOOL=bogus-tool &&
GIT_DIFF_TOOL=test-tool &&
- export GIT_MERGE_TOOL &&
export GIT_DIFF_TOOL &&
diff=$(git difftool --no-prompt branch) &&