summaryrefslogtreecommitdiff
path: root/git-difftool.perl
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.perl
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.perl')
-rwxr-xr-xgit-difftool.perl15
1 files changed, 12 insertions, 3 deletions
diff --git a/git-difftool.perl b/git-difftool.perl
index 8857ac8a4c..948ff7f6fd 100755
--- a/git-difftool.perl
+++ b/git-difftool.perl
@@ -2,9 +2,12 @@
# Copyright (c) 2009 David Aguilar
#
# This is a wrapper around the GIT_EXTERNAL_DIFF-compatible
-# git-difftool--helper script. This script exports
-# GIT_EXTERNAL_DIFF and GIT_PAGER for use by git, and
-# GIT_DIFFTOOL_NO_PROMPT and GIT_DIFF_TOOL for use by git-difftool--helper.
+# git-difftool--helper script.
+#
+# This script exports GIT_EXTERNAL_DIFF and GIT_PAGER for use by git.
+# GIT_DIFFTOOL_NO_PROMPT, GIT_DIFFTOOL_PROMPT, and GIT_DIFF_TOOL
+# are exported for use by git-difftool--helper.
+#
# Any arguments that are unknown to this script are forwarded to 'git diff'.
use strict;
@@ -62,6 +65,12 @@ sub generate_command
}
if ($arg eq '-y' || $arg eq '--no-prompt') {
$ENV{GIT_DIFFTOOL_NO_PROMPT} = 'true';
+ delete $ENV{GIT_DIFFTOOL_PROMPT};
+ next;
+ }
+ if ($arg eq '--prompt') {
+ $ENV{GIT_DIFFTOOL_PROMPT} = 'true';
+ delete $ENV{GIT_DIFFTOOL_NO_PROMPT};
next;
}
if ($arg eq '-h' || $arg eq '--help') {