]> git.ipfire.org Git - thirdparty/git.git/commit - diff.c
diff: move diff.wsErrorHighlight to "basic" config
authorJeff King <peff@peff.net>
Fri, 31 Jan 2020 09:57:49 +0000 (04:57 -0500)
committerJunio C Hamano <gitster@pobox.com>
Fri, 31 Jan 2020 20:01:19 +0000 (12:01 -0800)
commitda8063522f7f797cf722f28979aefbe2a508f800
tree7cb9726eb34814676724a7cdde5505e9efdc786f
parentd0654dc308b0ba76dd8ed7bbb33c8d8f7aacd783
diff: move diff.wsErrorHighlight to "basic" config

We parse diff.wsErrorHighlight in git_diff_ui_config(), meaning that it
doesn't take effect for plumbing commands, only for porcelains like
git-diff itself. This is mildly annoying as it means scripts like
add--interactive, which produce a user-visible diff with color, don't
respect the option.

We could teach that script to parse the config and pass it along as
--ws-error-highlight to the diff plumbing. But there's a simpler
solution.

It should be reasonably safe for plumbing to respect this option, as it
only kicks in when color is otherwise enabled. And anybody parsing
colorized output must already deal with the fact that color.diff.* may
change the exact output they see; those options have been part of
git_diff_basic_config() since its inception in 9a1805a872 (add a "basic"
diff config callback, 2008-01-04).

So we can just move it to the "basic" config, which fixes
add--interactive, along with any other script in the same boat, with a
very low risk of hurting any plumbing users.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c
t/t3701-add-interactive.sh