git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: git@vger.kernel.org, gitster@pobox.com
Subject: [PATCH] Add diff-option --ext-diff
Date: Sat, 30 Jun 2007 18:47:07 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0706301846580.4438@racer.site> (raw)


To prevent funky games with external diff engines, git-log and
friends prevent external diff engines from being called. That makes
sense in the context of git-format-patch or git-rebase.

However, for "git log -p" it is not so nice to get the message
that binary files cannot be compared, while "git diff" has no
problems with them, if you provided an external diff driver.

With this patch, "git log --ext-diff -p" will do what you expect,
and the option "--no-ext-diff" can be used to override that
setting.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 Documentation/diff-options.txt |    8 ++++++++
 diff.c                         |    4 ++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 0f07c9c..3d2b9d0 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -168,5 +168,13 @@
 --quiet::
 	Disable all output of the program. Implies --exit-code.
 
+--ext-diff::
+	Allow an external diff helper to be executed. If you set an
+	external diff driver with gitlink:gitattributes(5), you need
+	to use this option with gitlink:git-log(1) and friends.
+
+--no-ext-diff::
+	Disallow external diff drivers.
+
 For more detailed explanation on these common options, see also
 link:diffcore.html[diffcore documentation].
diff --git a/diff.c b/diff.c
index e0edb98..a471c9e 100644
--- a/diff.c
+++ b/diff.c
@@ -2241,6 +2241,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
 		options->exit_with_status = 1;
 	else if (!strcmp(arg, "--quiet"))
 		options->quiet = 1;
+	else if (!strcmp(arg, "--ext-diff"))
+		options->allow_external = 1;
+	else if (!strcmp(arg, "--no-ext-diff"))
+		options->allow_external = 0;
 	else
 		return 0;
 	return 1;
-- 
1.5.2.2.3249.g33841

                 reply	other threads:[~2007-06-30 17:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Pine.LNX.4.64.0706301846580.4438@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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).