Subject: Re: [PATCH v3 00/10] Xdiff cleanup part2

From: Junio C Hamano <[email-masked]>
Date: Tue, 11 Nov 2025 15:40:11 -0800

"Ezekiel Newren via GitGitGadget" <[email-masked]> writes:

> The primary goal of this patch series is to convert every field's type in
> xrecord_t and xdfile_t to be unambiguous, in preparation to make it more
> Rust FFI friendly. Additionally the ha field in xrecord_t is split into
> line_hash and minimal_perfect hash.

After having read the series to its end, I am left with this feeling
that it does only half the things that it needs to do.  It does all
what the above paragraph claims it does, sure, in that the relevant
data structures now use not "long" but "size_t", not "char" but
"uint8_t", etc., and I do find the resulting data structures sensibly
described.

But for the code to be truly consistent between the data structures
and the operations that work on them, types of on-stack variables
and function parameters would need to be updated to match these
struct members.  As we convert one structure member at a time, casts
may need to be sprinkled for assignments to these variables and
passing these struct members as parameters to functions (which I
commented on one of these patche) to keep the blast radius of the
changes in each step manageable, but I would have expected that
functions that used to take, say, an "int", would be updated to take
"size_t" if the value coming to the parameter is from these struct
members.

Perhaps that would be the theme for "Xdiff cleanup part 3" series
that we will eventually see after the dust settles from this round?

Thanks.