Subject: [PATCH 00/10] Xdiff cleanup part 3

From: "Ezekiel Newren via GitGitGadget" <[email-masked]>
Date: Fri, 02 Jan 2026 18:52:14 +0000

Patch series summary:

 * patch 1: Introduce the ivec type
 * patch 2: Create the function xdl_do_classic_diff()
 * patches 3-4: generic cleanup
 * patches 5-8: convert from dstart/dend (in xdfile_t) to
   delta_start/delta_end (in xdfenv_t)
 * patches 9-10: move xdl_cleanup_records(), and related, from xprepare.c to
   xdiffi.c

Things that will be addressed in future patch series:

 * Make xdl_cleanup_records() easier to read
 * convert recs/nrec into an ivec
 * convert changed to an ivec
 * remove reference_index/nreff from xdfile_t and turn it into an ivec
 * splitting minimal_perfect_hash out as its own ivec
 * improve the performance of the classifier and parsing/hashing lines

=== before this patch series typedef struct s_xdfile { xrecord_t *recs;
size_t nrec; ptrdiff_t dstart, dend; bool *changed; size_t *reference_index;
size_t nreff; } xdfile_t;

typedef struct s_xdfenv { xdfile_t xdf1, xdf2; } xdfenv_t;

=== after this patch series typedef struct s_xdfile { xrecord_t *recs;
size_t nrec; bool *changed; size_t *reference_index; size_t nreff; }
xdfile_t;

typedef struct s_xdfenv { xdfile_t xdf1, xdf2; size_t delta_start,
delta_end; size_t mph_size; } xdfenv_t;

Ezekiel Newren (10):
  ivec: introduce the C side of ivec
  xdiff: make classic diff explicit by creating xdl_do_classic_diff()
  xdiff: don't waste time guessing the number of lines
  xdiff: let patience and histogram benefit from xdl_trim_ends()
  xdiff: use xdfenv_t in xdl_trim_ends() and xdl_cleanup_records()
  xdiff: cleanup xdl_trim_ends()
  xdiff: replace xdfile_t.dstart with xdfenv_t.delta_start
  xdiff: replace xdfile_t.dend with xdfenv_t.delta_end
  xdiff: remove dependence on xdlclassifier from xdl_cleanup_records()
  xdiff: move xdl_cleanup_records() from xprepare.c to xdiffi.c

 Makefile           |   1 +
 compat/ivec.c      | 113 ++++++++++++++++++
 compat/ivec.h      |  52 +++++++++
 meson.build        |   1 +
 xdiff/xdiffi.c     | 221 +++++++++++++++++++++++++++++++++---
 xdiff/xdiffi.h     |   1 +
 xdiff/xhistogram.c |   7 +-
 xdiff/xpatience.c  |   7 +-
 xdiff/xprepare.c   | 277 ++++++++-------------------------------------
 xdiff/xtypes.h     |   3 +-
 xdiff/xutils.c     |  20 ----
 xdiff/xutils.h     |   1 -
 12 files changed, 432 insertions(+), 272 deletions(-)
 create mode 100644 compat/ivec.c
 create mode 100644 compat/ivec.h

base-commit: 66ce5f8e8872f0183bb137911c52b07f1f242d13
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2156%2Fezekielnewren%2Fxdiff-cleanup-3-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2156/ezekielnewren/xdiff-cleanup-3-v1
Pull-Request: https://github.com/git/git/pull/2156
-- 
gitgitgadget