summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 37a7744)
raw | patch | inline | side by side (parent: 37a7744)
author | Junio C Hamano <gitster@pobox.com> | |
Wed, 26 Nov 2008 17:58:41 +0000 (09:58 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 26 Nov 2008 17:58:41 +0000 (09:58 -0800) |
The original intention of 72909be (Add diff-option --ext-diff, 2007-06-30)
was to optionally allow the use of external diff viewer in "git log"
family (while keeping them disabled by default). It exposed the "allow
external diff" bit to the UI, but forgot to adjust the "git diff" codepath
that was set up to always allow use of the external diff viewer.
Noticed by Nazri Ramliy; tests by René Scharfe squashed in.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
was to optionally allow the use of external diff viewer in "git log"
family (while keeping them disabled by default). It exposed the "allow
external diff" bit to the UI, but forgot to adjust the "git diff" codepath
that was set up to always allow use of the external diff viewer.
Noticed by Nazri Ramliy; tests by René Scharfe squashed in.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-diff.c | patch | blob | history | |
t/t4020-diff-external.sh | patch | blob | history |
diff --git a/builtin-diff.c b/builtin-diff.c
index d5fe775fc135c0905cabec6731104009ca3bfef3..26cf6785918300f3a0998a1811adb71ec6ec7b73 100644 (file)
--- a/builtin-diff.c
+++ b/builtin-diff.c
/* Otherwise, we are doing the usual "git" diff */
rev.diffopt.skip_stat_unmatch = !!diff_auto_refresh_index;
+ /* Default to let external be used */
+ DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL);
+
if (nongit)
die("Not a git repository");
argc = setup_revisions(argc, argv, &rev, NULL);
if (diff_setup_done(&rev.diffopt) < 0)
die("diff_setup_done failed");
}
- DIFF_OPT_SET(&rev.diffopt, ALLOW_EXTERNAL);
+
DIFF_OPT_SET(&rev.diffopt, RECURSIVE);
/*
index 637b4e19d52e81cf1472a4ed9dcfb0c9ff00da2b..22ef7d44b08ac7ec20e799a194e27205c794c290 100755 (executable)
--- a/t/t4020-diff-external.sh
+++ b/t/t4020-diff-external.sh
'
+test_expect_success 'GIT_EXTERNAL_DIFF environment and --no-ext-diff' '
+
+ GIT_EXTERNAL_DIFF=echo git diff --no-ext-diff |
+ grep "^diff --git a/file b/file"
+
+'
+
test_expect_success 'diff attribute' '
git config diff.parrot.command echo &&
'
+test_expect_success 'diff attribute and --no-ext-diff' '
+
+ git diff --no-ext-diff |
+ grep "^diff --git a/file b/file"
+
+'
+
test_expect_success 'diff attribute' '
git config --unset diff.parrot.command &&
'
+test_expect_success 'diff attribute and --no-ext-diff' '
+
+ git diff --no-ext-diff |
+ grep "^diff --git a/file b/file"
+
+'
+
test_expect_success 'no diff with -diff' '
echo >.gitattributes "file -diff" &&
git diff | grep Binary