git/xdiff
Ævar Arnfjörð Bjarmason 5d93460024 xdiff-interface: replace discard_hunk_line() with a flag
Remove the dummy discard_hunk_line() function added in
3b40a090fd (diff: avoid generating unused hunk header lines,
2018-11-02) in favor of having a new XDL_EMIT_NO_HUNK_HDR flag, for
use along with the two existing and similar XDL_EMIT_* flags.

Unlike the recently amended xdiff_emit_line_fn interface which'll be
called in a loop in xdl_emit_diff(), the hunk header is only emitted
once.

It makes more sense to pass this as a flag than provide a dummy
callback because that function may be able to skip doing certain work
if it knows the caller is doing nothing with the hunk header.

It would be possible to do so in the case of -U0 now, but the benefit
of doing so is so small that I haven't bothered. But this leaves the
door open to that, and more importantly makes the API use more
intuitive.

The reason we're putting a flag in the gap between 1<<0 and 1<<2 is
that the old 1<<1 flag was removed in 907681e940 (xdiff: drop
XDL_EMIT_COMMON, 2016-02-23) without re-ordering the remaining flags.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-05-11 12:47:31 +09:00
..
xdiff.h xdiff-interface: replace discard_hunk_line() with a flag 2021-05-11 12:47:31 +09:00
xdiffi.c diff: add -I<regex> that ignores matching changes 2020-10-20 12:53:26 -07:00
xdiffi.h
xemit.c xdiff-interface: replace discard_hunk_line() with a flag 2021-05-11 12:47:31 +09:00
xemit.h
xhistogram.c merge-base, xdiff: zero out xpparam_t structures 2020-10-20 12:53:26 -07:00
xinclude.h xdiff: use git-compat-util 2019-04-12 13:34:17 +09:00
xmacros.h
xmerge.c
xpatience.c merge-base, xdiff: zero out xpparam_t structures 2020-10-20 12:53:26 -07:00
xprepare.c
xprepare.h
xtypes.h
xutils.c xdiff: drop system includes in xutils.c 2019-07-28 21:51:19 -07:00
xutils.h