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

Re: What's cooking in git.git (Jul 2016, #05; Wed, 13)

From
Duy Nguyen <pclouds@gmail.com>
Date
Jul 13, 2016, 17:40 UTC
Message-ID
<CACsJy8CVJr6-9CnyrOU4UoPPGu6Ovn_=-2YKeqC8Lp_rVnh5fg@mail.gmail.com>
In-Reply-To
<xmqqy4551nph.fsf@gitster.mtv.corp.google.com>
On Wed, Jul 13, 2016 at 6:56 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> * nd/pack-ofs-4gb-limit (2016-07-13) 7 commits
>  - fsck: use streaming interface for large blobs in pack
>  - pack-objects: do not truncate result in-pack object size on 32-bit systems
>  - index-pack: correct "offset" type in unpack_entry_data()
>  - index-pack: report correct bad object offsets even if they are large
>  - index-pack: correct "len" type in unpack_data()
>  - sha1_file.c: use type off_t* for object_info->disk_sizep
>  - pack-objects: pass length to check_pack_crc() without truncation
>
>  "git pack-objects" and "git index-pack" mostly operate with off_t
>  when talking about the offset of objects in a packfile, but there
>  were a handful of places that used "unsigned long" to hold that
>  value, leading to an unintended truncation.

On the subject of truncation, there is something else I should note. The field sd_size in struct stat_data is 32 bits, so large files will overflow it too, regardless of platforms. I did not do anything because I checked and double checked and was pretty sure we did not use it for anything meaningful (as a file size). To us, it's just another random number, like st_ino, that we check to detect if a file has changed.

It's probably just an oversight (it comes from the very first "the information manager from hell" commit). But it's not worth changing index format now to extend it to 64 bits, I think. So it's ok, no worry about it, but we should probably make clear that this is not true file size, and don't anybody ever use it as such. Maybe rename it to "size_hash" or something.

-- 
Duy
Previous: Jeff KingNext: Junio C Hamano
Message 8 of 21 in “What's cooking in git.git (Jul 2016, #05; Wed, 13)”
  1. Junio C HamanoJul 13, 2016
  2. Stefan BellerJul 13, 2016
  3. Junio C HamanoJul 13, 2016
  4. Stefan BellerJul 13, 2016
  5. Junio C HamanoJul 13, 2016
  6. Junio C HamanoJul 13, 2016
  7. Jeff KingJul 13, 2016
  8. Duy NguyenJul 13, 2016
  9. Junio C HamanoJul 13, 2016
  10. Johannes SchindelinJul 14, 2016
  11. Johannes SchindelinJul 14, 2016
  12. Junio C HamanoJul 14, 2016
  13. Johannes SchindelinJul 14, 2016
  14. Junio C HamanoJul 14, 2016
  15. Lars SchneiderJul 16, 2016
  16. Eric WongJul 16, 2016
  17. Lars SchneiderJul 16, 2016
  18. list: avoid incompatibility with *BSD sys/queue.hEric Wong, Jul 17, 2016
  19. Eric SunshineJul 17, 2016
  20. Eric WongJul 17, 2016
  21. Lars SchneiderJul 18, 2016

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.