diff options
author | Jeff King <peff@peff.net> | 2012-07-19 07:49:38 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-07-19 10:17:05 -0700 |
commit | c12f82ae631eb07d0ee6a61003754d103025a0b3 (patch) | |
tree | a65261b2b1219a64e59482e5c265f74a8839b33c /builtin/upload-archive.c | |
parent | diff: correctly disable external_diff with --no-ext-diff (diff) | |
download | tgif-c12f82ae631eb07d0ee6a61003754d103025a0b3.tar.xz |
diff: test precedence of external diff drivers
There are three ways to specify an external diff command:
GIT_EXTERNAL_DIFF in the environment, diff.external in the
config, or a "diff" gitattribute. The current order of
precedence is:
1. gitattribute
2. GIT_EXTERNAL_DIFF
3. diff.external
Usually our rule is that environment variables should take
precedence over on-disk config (i.e., option 2 should come
before option 1). However, this situation is trickier than
some, because option 1 is more specific to the individual
file than option 2 (which affects all files), so it might be
preferable. So the current behavior can be seen as
implementing "do the specific thing if we can, but fall back
to this general thing".
This is probably not what we would do if we were writing git
from scratch, but it has been this way for several years,
and is not worth changing. So let's at least document that
this is the way it's supposed to work with a test.
While we're there, let's also make sure that diff.external
(which was not previously tested at all) works by running it
through the same tests as GIT_EXTERNAL_DIFF.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/upload-archive.c')
0 files changed, 0 insertions, 0 deletions