]> git.ipfire.org Git - thirdparty/git.git/commit - range-diff.h
range-diff: relieve callers of low-level configuration burden
authorEric Sunshine <sunshine@sunshineco.com>
Sun, 22 Jul 2018 09:57:12 +0000 (05:57 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 14 Aug 2018 21:27:04 +0000 (14:27 -0700)
commit73a834e9e27906a76940f1ced5c132bce205d3f8
treee54e674b2e78723a111cf40733dd453fba5ed3f3
parent25668659bfd74a71de6dd27eac437a17ad72a315
range-diff: relieve callers of low-level configuration burden

There are a number of very low-level configuration details which need to
be managed precisely to generate a proper range-diff. In particular,
'diff_options' output format, header suppression, indentation, and
dual-color mode must all be set appropriately to ensure proper behavior.

Handle these details locally in the libified range-diff back-end rather
than forcing each caller to have specialized knowledge of these
implementation details, and to avoid duplication as new callers are
added.

While at it, localize these tweaks to be active only while generating
the range-diff, so they don't clobber the caller-provided
'diff_options', which might be used beyond range-diff generation.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/range-diff.c
range-diff.c
range-diff.h