Elia Pinto's series covers places where 32-bit types are used for sizes on every platform, found by scanning a 64-bit Linux build with -Wshorten-64-to-32. The three patches address a corrupt pack when pack-objects writes a compressed buffer of 4 GiB or more through hashwrite(), a wrong 'diff -B --stat' for files of 2 GiB or more in count_lines(), and missed renames for files of 4 GiB or more in hash_chars(). The cover letter says no tests are included because they would need GiB-sized inputs; the fixes were checked by simulation.
Junio Hamano raised several concerns. On the hash_chars() change he noted that the cnt member of spanhash is still an unsigned int and could wrap to 0 after about four billion collisions, making a bucket look empty. He asked whether it should be widened too, or why it need not be.
On the commit messages, Hamano said the detailed write-up leaves a key question unanswered: using a wider type avoids overflowing a narrower accumulator, but what deals with the wider accumulator overflowing after enough values are added? He said the remaining log messages share the same gap.
On hashwrite(), Hamano pointed out that src/csum_file.rs still declares the length as u32. He wondered whether a caller with a contiguous region over 4 GiB should instead loop in chunks of 4 GiB or less, leaving the API contract alone. brian m. carlson replied that this would be the right thing to do, and that if the C signature is changed the Rust code must be updated to match.
Elia Pinto also sent a patch that widens the diffstat totals in show_stats() and show_shortstats() from int to uintmax_t. Without it, a rewrite of a 2^31-line file prints a negative insertion count. Another patch explains that with -B, should_break() loads file contents without the binary check, so core.bigFileThreshold and MAX_XDIFF_SIZE never apply and an oversized file can reach count_lines(). Torsten Bögershausen said one of the patches looked good and that the test case passed on macOS.
What remains is whether the series changes the hashwrite() signature, which would require Rust updates, or keeps it and chunks in callers, plus revised commit messages that address accumulator overflow.