summaryrefslogtreecommitdiff
path: root/git-difftool--helper.sh
diff options
context:
space:
mode:
authorDavid Aguilar <davvid@gmail.com>2009-04-07 01:21:22 -0700
committerJunio C Hamano <gitster@pobox.com>2009-04-07 22:19:56 -0700
commita904392eaeee1629c0ac14dae8e579bb8497636a (patch)
treefeaacf73a572e72cb424b7691ef37a89d2a214cf /git-difftool--helper.sh
parentf92f2038a5192ac5fc1bb4f38c49906aa45b3f1e (diff)
downloadgit-a904392eaeee1629c0ac14dae8e579bb8497636a.tar.gz
difftool: add support for a difftool.prompt config variable
difftool now supports difftool.prompt so that users do not have to pass --no-prompt or hit enter each time a diff tool is launched. The --prompt flag overrides the configuration variable. Signed-off-by: David Aguilar <davvid@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-difftool--helper.sh')
-rwxr-xr-xgit-difftool--helper.sh10
1 files changed, 8 insertions, 2 deletions
diff --git a/git-difftool--helper.sh b/git-difftool--helper.sh
index fc61416acb..f3c27d86ad 100755
--- a/git-difftool--helper.sh
+++ b/git-difftool--helper.sh
@@ -5,9 +5,15 @@
#
# Copyright (c) 2009 David Aguilar
-# Set GIT_DIFFTOOL_NO_PROMPT to bypass the per-file prompt.
+# difftool.prompt controls the default prompt/no-prompt behavior
+# and is overridden with $GIT_DIFFTOOL*_PROMPT.
should_prompt () {
- test -z "$GIT_DIFFTOOL_NO_PROMPT"
+ prompt=$(git config --bool difftool.prompt || echo true)
+ if test "$prompt" = true; then
+ test -z "$GIT_DIFFTOOL_NO_PROMPT"
+ else
+ test -n "$GIT_DIFFTOOL_PROMPT"
+ fi
}
# This function prepares temporary files and launches the appropriate