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

Re: [PATCH v2 1/4] unpack-objects: use size_t for object sizes

From
Elia Pinto <gitter.spiros@gmail.com>
Date
Nov 19, 2026, 06:05 UTC
Message-ID
<20261119060524.775205-1-gitter.spiros@gmail.com>
In-Reply-To
<av2pBh7vLj5DVDha@pks.im>
On Wed, Nov 18, 2026 at 02:33:12PM +0100, Patrick Steinhardt wrote:
> Phew, this commit message really is extremely verbose, and I eventually
> lost steam reading through it halfways.
[...]
> So overall I bet that this message
> could be condensed to half or even a third of its size without losing
> much information.

Fair enough. I will cut it down to what the diff does not show: why the cast moves to write_object() and what changes for the user.

Show 6 quoted lines
> These casts here make me a bit unhappy, as you also have a patch series
> in flight that fix `odb_write_object()`. So you'll have to send another
> patch series after both have landed to remove those again.
>
> Would it make more sense to defer this series here until the other one
> lands?

Yes. odb_write_object() is changed by "use size_t for a few more object and buffer sizes" [1], and parse_object_buffer() and fsck_object() by "use size_t when parsing and checking objects" [2]. Once both are in, write_object() can pass the size on without a cast.

4/4 depends on [2] as well (see my reply there), so I will hold back 1/4 and 4/4 and resend them on top of [1] and [2]. 2/4 and 3/4 depend on neither: 2/4 fixes a bug on all platforms, 3/4 a false "SHA1 COLLISION FOUND". Unless you or Junio prefer otherwise, I will send those two on their own as v3, with your comments on 2/4 addressed.

[1] https://lore.kernel.org/git/cover.1793439137.git.gitter.spiros@gmail.com/ [2] https://lore.kernel.org/git/cover.1793444420.git.gitter.spiros@gmail.com/

Thanks, Elia

Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 11 of 20 in “use size_t when receiving and verifying packs”
  1. 0/4 use size_t when receiving and verifying packsElia Pinto, Oct 31, 2026
  2. 1/4 unpack-objects: use size_t for object sizesElia Pinto, Oct 31, 2026
  3. 2/4 index-pack: use size_t in write_compressed()Elia Pinto, Oct 31, 2026
  4. 3/4 index-pack: use size_t for object sizesElia Pinto, Oct 31, 2026
  5. 4/4 pack-check: use size_t for the size passed to verify callbacksElia Pinto, Oct 31, 2026
  6. 0/4 use size_t when receiving and verifying packsElia Pinto, Nov 18, 2026
  7. 1/4 unpack-objects: use size_t for object sizesElia Pinto, Nov 18, 2026
  8. Patrick SteinhardtNov 18, 2026
  9. Junio C HamanoNov 18, 2026
  10. Patrick SteinhardtNov 19, 2026
  11. Elia PintoNov 19, 2026
  12. Patrick SteinhardtNov 19, 2026
  13. Elia PintoNov 19, 2026
  14. 2/4 index-pack: use size_t in write_compressed()Elia Pinto, Nov 18, 2026
  15. Patrick SteinhardtNov 18, 2026
  16. Elia PintoNov 19, 2026
  17. 3/4 index-pack: use size_t for object sizesElia Pinto, Nov 18, 2026
  18. 4/4 pack-check: use size_t for the size passed to verify callbacksElia Pinto, Nov 18, 2026
  19. Patrick SteinhardtNov 18, 2026
  20. Elia PintoNov 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.