Skip to content

Commit

Permalink
Add diff-option --ext-diff
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Jul 4, 2007
1 parent c401b33 commit 72909be
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Documentation/diff-options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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].
4 changes: 4 additions & 0 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 72909be

Please sign in to comment.