{"thread":{"id":"8782","subject":"[PATCH] Add diff-option --ext-diff","startedAt":"2007-06-30T17:47:07Z","lastAt":"2007-06-30T17:47:07Z","messageCount":1,"participants":["Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"46104","messageId":"Pine.LNX.4.64.0706301846580.4438@racer.site","threadId":"8782","inReplyTo":null,"subject":"[PATCH] Add diff-option --ext-diff","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-06-30T17:47:07Z","receivedAt":"2007-06-30T17:47:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nTo prevent funky games with external diff engines, git-log and\nfriends prevent external diff engines from being called. That makes\nsense in the context of git-format-patch or git-rebase.\n\nHowever, for \"git log -p\" it is not so nice to get the message\nthat binary files cannot be compared, while \"git diff\" has no\nproblems with them, if you provided an external diff driver.\n\nWith this patch, \"git log --ext-diff -p\" will do what you expect,\nand the option \"--no-ext-diff\" can be used to override that\nsetting.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n Documentation/diff-options.txt |    8 ++++++++\n diff.c                         |    4 ++++\n 2 files changed, 12 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex 0f07c9c..3d2b9d0 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -168,5 +168,13 @@\n --quiet::\n \tDisable all output of the program. Implies --exit-code.\n \n+--ext-diff::\n+\tAllow an external diff helper to be executed. If you set an\n+\texternal diff driver with gitlink:gitattributes(5), you need\n+\tto use this option with gitlink:git-log(1) and friends.\n+\n+--no-ext-diff::\n+\tDisallow external diff drivers.\n+\n For more detailed explanation on these common options, see also\n link:diffcore.html[diffcore documentation].\ndiff --git a/diff.c b/diff.c\nindex e0edb98..a471c9e 100644\n--- a/diff.c\n+++ b/diff.c\n@@ -2241,6 +2241,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)\n \t\toptions->exit_with_status = 1;\n \telse if (!strcmp(arg, \"--quiet\"))\n \t\toptions->quiet = 1;\n+\telse if (!strcmp(arg, \"--ext-diff\"))\n+\t\toptions->allow_external = 1;\n+\telse if (!strcmp(arg, \"--no-ext-diff\"))\n+\t\toptions->allow_external = 0;\n \telse\n \t\treturn 0;\n \treturn 1;\n-- \n1.5.2.2.3249.g33841\n"}]}