git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Nazri Ramliy" <ayiehere@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH (Eek!)] git diff does not honor --no-ext-diff
Date: Tue, 25 Nov 2008 23:52:41 -0800	[thread overview]
Message-ID: <7vprkihqk6.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <544dda350811252312u7ef5533bwb20b37640d861487@mail.gmail.com> (Nazri Ramliy's message of "Wed, 26 Nov 2008 15:12:25 +0800")

"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);
 

  reply	other threads:[~2008-11-26  7:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-26  7:12 [PATCH (Eek!)] git diff does not honor --no-ext-diff Nazri Ramliy
2008-11-26  7:52 ` Junio C Hamano [this message]
2008-11-26  7:59   ` René Scharfe
2008-11-26 10:01     ` Nazri Ramliy

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=7vprkihqk6.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=ayiehere@gmail.com \
    --cc=git@vger.kernel.org \
    /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).