• Jeff King's avatar
    xdiff: provide a separate emit callback for hunks · 611e42a5
    Jeff King authored
    The xdiff library always emits hunk header lines to our callbacks as
    formatted strings like "@@ -a,b +c,d @@\n". This is convenient if we're
    going to output a diff, but less so if we actually need to compute using
    those numbers, which requires re-parsing the line.
    
    In preparation for moving away from this, let's teach xdiff a new
    callback function which gets the broken-out hunk information. To help
    callers that don't want to use this new callback, if it's NULL we'll
    continue to format the hunk header into a string.
    
    Note that this function renames the "outf" callback to "out_line", as
    well. This isn't strictly necessary, but helps in two ways:
    
      1. Now that there are two callbacks, it's nice to use more descriptive
         names.
    
      2. Many callers did not zero the emit_callback_data struct, and needed
         to be modified to set ecb.out_hunk to NULL. By changing the name of
         the existing struct member, that guarantees that any new callers
         from in-flight topics will break the build and be examined
         manually.
    Signed-off-by: default avatarJeff King <peff@peff.net>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    611e42a5
Name
Last commit
Last update
..
xdiff.h Loading commit data...
xdiffi.c Loading commit data...
xdiffi.h Loading commit data...
xemit.c Loading commit data...
xemit.h Loading commit data...
xhistogram.c Loading commit data...
xinclude.h Loading commit data...
xmacros.h Loading commit data...
xmerge.c Loading commit data...
xpatience.c Loading commit data...
xprepare.c Loading commit data...
xprepare.h Loading commit data...
xtypes.h Loading commit data...
xutils.c Loading commit data...
xutils.h Loading commit data...