git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/3] xdiff: drop LONG_MAX check on merge result size

From
TJTanga Joris <tangajoris@gmail.com>
Date
Nov 19, 2026, 23:50 UTC
Message-ID
<CAKrRMNqMRkkb9+n+11p04YDhn6p39uoc_Upc9voYhZZoLyPXBA@mail.gmail.com>
In-Reply-To
<20261117174353.1158905-8-christian.couder@gmail.com>
Hello Christian,
Great work with the series.

On Tue, 17 Nov 2026 at 20:46, Christian Couder <christian.couder@gmail.com> wrote:

> Let's then get rid of this `size > LONG_MAX` check and allow sizes as
> big as `size_t` allows, so that merges with results over 2 GiB no
> longer fail on 64-bit Windows.

I ran t4300 with GIT_TEST_LONG=1 on a Windows server runner on GitHub Actions, as you requested in the cover letter:

https://github.com/tmjoris/git/actions/runs/44423166965

On e1ec09b23c, the two big merge tests are skipped, because long is 32 bits there. "merge-tree dies when merge buffer size does not fit long" passes. With the series on top, both big merge tests pass.

I also ran it natively on a Windows laptop with the Git SDK, and got similar results.

I went through the other callers of ll_merge() and xdl_merge(), to see if any of them still pass the result through an unsigned long. They all end up in odb_write_object(), write_buf_to_worktree(), strbuf_attach() or fwrite(), which all take a size_t with this series. So I agree the check is not needed anymore.

Looks good to me.

Thanks, Tanga

Previous: Christian Couder
Message 8 of 8 in “Allow merges with results over 2 GiB on 64-bit Windows”
  1. 0/3 Allow merges with results over 2 GiB on 64-bit WindowsChristian Couder, Nov 17, 2026
  2. 1/3 notes-merge: use size_t in write_buf_to_worktree()Christian Couder, Nov 17, 2026
  3. Patrick SteinhardtNov 18, 2026
  4. 2/3 odb: widen odb_write_object() length to size_tChristian Couder, Nov 17, 2026
  5. Patrick SteinhardtNov 18, 2026
  6. Christian CouderNov 18, 2026
  7. 3/3 xdiff: drop LONG_MAX check on merge result sizeChristian Couder, Nov 17, 2026
  8. Tanga JorisNov 19, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.