From: David Aguilar <davvid@gmail.com>
To: gitster@pobox.com
Cc: git@vger.kernel.org, markus.heidelberg@web.de
Subject: [PATCH 2/4] difftool--helper: Remove use of the GIT_MERGE_TOOL variable
Date: Sat, 9 Jan 2010 20:02:41 -0800 [thread overview]
Message-ID: <1263096163-15743-2-git-send-email-davvid@gmail.com> (raw)
In-Reply-To: <1263096163-15743-1-git-send-email-davvid@gmail.com>
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>
---
git-difftool--helper.sh | 9 ++++-----
t/t7800-difftool.sh | 9 ---------
2 files changed, 4 insertions(+), 14 deletions(-)
diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index 1b13808..3621f28 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -40,11 +40,10 @@ launch_merge_tool () {
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 9bf6c98..eca51a8 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -32,7 +32,6 @@ restore_test_defaults()
# 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 &&
@@ -107,15 +106,7 @@ test_expect_success 'GIT_DIFF_TOOL overrides' '
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) &&
--
1.6.6.4.g20a38b.dirty
next prev parent reply other threads:[~2010-01-10 4:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-10 4:02 [PATCH 1/4] difftool--helper: Update copyright and remove distracting comments David Aguilar
2010-01-10 4:02 ` David Aguilar [this message]
2010-01-10 4:02 ` [PATCH 3/4] difftool: Allow specifying unconfigured commands with --extcmd David Aguilar
2010-01-10 4:02 ` [PATCH 4/4] git-diff.txt: Link to git-difftool David Aguilar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1263096163-15743-2-git-send-email-davvid@gmail.com \
--to=davvid@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=markus.heidelberg@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).