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

Re: [PATCH 09/13] drop objects larger than --blob-limit if specified

From
Junio C Hamano <junkio@cox.net>
Date
Apr 6, 2007, 22:33 UTC
Message-ID
<7v1wixjfpo.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0704061214230.6730@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 13 quoted lines
> On Fri, 6 Apr 2007, Dana How wrote:
>> ...
>> * Avoiding (e.g.) 2GB+ files when none already exist in the repository --
>>  either the filesystem doesn't support anything beyond the limit,
>>  or we don't want to use a >31b off_t with mmap.  (Perhaps
>>  the latter case is completely avoided by some glibc 64b trickery,
>>  but is that always true?)  Only the write rollback approach can address this.
>
> I disagree violently. 
>
> IN THEORY only write rollback can address that. But "theory" is not 
> practice, and anybody who thinks that theory is even *relevant* here is 
> missing the big picture.

Although I agree the "starting offset" is a very good compromise, if we talk about THEORY, you should be able to notice you are going to go beyond the limit inside write_one(). At that point, we know everything we need to know about all objects that might be involved in writing that one object: if they have been written out, what their offsets are, and how big their in-pack representation will be.

And I agree with Nico that rollback after a failed write beyond the boundary may not work correctly, so if we really want to do this safely and sanely while satisfying Dana's desire to have a hard limit, I think something like this is needed:

 - use "starting offset" to decide when to split;
 - introduce a "hard limit", perhaps optionally, to make sure
   that the result of writing out a packfile does not overstep
   that limit (i.e. the last object written below the "starting
   offset limit" might make the pack go over 700MB).

which means you would specify 600 as starting offset limit and 680 (or something like that) as the hard tail offset limit

> Again, *in*practice*, for any sane situation, if you want to fit things on 
> a CD-ROM, just give a limit of 600MB, and I can pretty much guarantee that 
> you'll see a slop of just a percent or two for any realistic setup. And if 
> it goes up to 660MB, you'll still fit on any CD.
if you really care the result fits on a CD.
Previous: Linus TorvaldsNext: David Lang
Message 9 of 11 in “drop objects larger than --blob-limit if specified”
  1. 09/13 drop objects larger than --blob-limit if specifiedDana How, Apr 5, 2007
  2. Nicolas PitreApr 6, 2007
  3. Dana HowApr 6, 2007
  4. Nicolas PitreApr 6, 2007
  5. Linus TorvaldsApr 6, 2007
  6. Dana HowApr 6, 2007
  7. Nicolas PitreApr 6, 2007
  8. Linus TorvaldsApr 6, 2007
  9. Junio C HamanoApr 6, 2007
  10. David LangApr 8, 2007
  11. Nicolas PitreApr 6, 2007

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.