@matheusbsbs / matheus-bagliano / commits / 72909befaa
Fork 0

Add diff-option --ext-diff

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>

Johannes Schindelin committed Jun 30, 2007 at 18:47 UTC 72909befaa043fcc975115bb56d25a6e7dc65fb6
2 files changed +12
Documentation/diff-options.txt
+8
@@ -168,5 +168,13 @@
168 --quiet::
169 Disable all output of the program. Implies --exit-code.
170
171 +--ext-diff::
172 + Allow an external diff helper to be executed. If you set an
173 + external diff driver with gitlink:gitattributes(5), you need
174 + to use this option with gitlink:git-log(1) and friends.
175 +
176 +--no-ext-diff::
177 + Disallow external diff drivers.
178 +
179 For more detailed explanation on these common options, see also
180 link:diffcore.html[diffcore documentation].
diff.c
+4
@@ -2241,6 +2241,10 @@ int diff_opt_parse(struct diff_options *options, const char **av, int ac)
2241 options->exit_with_status = 1;
2242 else if (!strcmp(arg, "--quiet"))
2243 options->quiet = 1;
2244 + else if (!strcmp(arg, "--ext-diff"))
2245 + options->allow_external = 1;
2246 + else if (!strcmp(arg, "--no-ext-diff"))
2247 + options->allow_external = 0;
2248 else
2249 return 0;
2250 return 1;