diff: retire sane_truncate_fn
authorJunio C Hamano <gitster@pobox.com>
Thu, 17 Aug 2017 17:27:28 +0000 (10:27 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Aug 2017 21:38:22 +0000 (14:38 -0700)
commit08a8509e50e560e3d14adb05698efe9ff063bbd3
tree07718f9632c9b1506ffe35953e7382e285d20f1d
parentb3622a4ee94e4916cd05e6d96e41eeb36b941182
diff: retire sane_truncate_fn

Long time ago, 23707811 ("diff: do not chomp hunk-header in the
middle of a character", 2008-01-02) introduced sane_truncate_line()
helper function to trim the "function header" line that is shown at
the end of the hunk header line, in order to avoid chomping it in
the middle of a single UTF-8 character.  It also added a facility to
define a custom callback function to make it possible to extend it
to non UTF-8 encodings.

During the following 8 1/2 years, nobody found need for this custom
callback facility.

A custom callback function is a wrong design to use here anyway---if
your contents need support for non UTF-8 encoding, you shouldn't
have to write a custom function and recompile Git to plumb it in.  A
better approach would be to extend sane_truncate_line() function and
have a new member in emit_callback to conditionally trigger it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff.c