git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH (Eek!)] git diff does not honor --no-ext-diff

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 26, 2008, 07:52 UTC
Message-ID
<7vprkihqk6.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<544dda350811252312u7ef5533bwb20b37640d861487@mail.gmail.com>
"Nazri Ramliy" <ayiehere@gmail.com> writes:
> git-diff does not honor the --no-ext-diff option in both cases when the external
> diff program is set via diff.external and gitattributes.
>
> Is this intentional?

Judging from 72909be (Add diff-option --ext-diff, 2007-06-30), I think this was intended in the sense that --ext-diff and --no-ext-diff were meant to be no-op for "diff" itself when they were introduced.

Having said that, I do not know if I agree with the original intention. It looks more like an oversight that came from focusing only on what a new behaviour for the "log" family should be, than a logical design decision to exclude "diff" from this codepath.

Wouldn't this be a better patch?
 builtin-diff.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
diff --git c/builtin-diff.c w/builtin-diff.c
index 7ceceeb..b90d8bc 100644
--- c/builtin-diff.c
+++ w/builtin-diff.c
@@ -290,6 +290,9 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 	/* 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);
@@ -298,7 +301,7 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 		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);
 	DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
 
Previous: Nazri RamliyNext: René Scharfe
Message 2 of 4 in “git diff does not honor --no-ext-diff”
  1. git diff does not honor --no-ext-diffNazri Ramliy, Nov 26, 2008
  2. Junio C HamanoNov 26, 2008
  3. René ScharfeNov 26, 2008
  4. Nazri RamliyNov 26, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.