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

Re: [PATCH v0 3/3] Bigfile: teach "git add" to send a large file straight to a pack

From
Junio C Hamano <gitster@pobox.com>
Date
May 9, 2011, 16:14 UTC
Message-ID
<7vzkmvq2b2.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7v4o53rhkv.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 19 quoted lines
> I envisioned that the "API" I talked about in the NEEDSWORK you quoted
> would keep an open file descriptor to the "currently being built" packfile
> wrapped in a "struct packed_git", with an in-core index_data that is
> adjusted every time you add a straight-to-pack kind of object. Upon a
> "finalize" call, it would determines the final pack name, write the real
> pack .idx file out, and rename the "being built" packfile to the final
> name to make it available to the outside world.
>
> Within a single git process that approach would give access to the set of
> objects that are going straight to the pack.  When it needs to spawn a git
> subprocess, it however would need to finalize the pack to give access to
> the new object, just like when fast-import flushes when asked to expose
> the marks.
>
> After all, this topic is about handling large binary files that would not
> fit in core at once (we do not support them now at all). It may not too
> bad to say we stuff one object per packfile and immediately close the
> packfile (which is what the use of fast-import by the POC patch
> does).
A (tentatively final) side note.

The primary reason why I wanted to think about using a single packfile that is kept open and add multiple objects to the pack was because we may later want to use this kind of set-up for "initial import", regardless of the size of the object being added. But now I think about it I do not think that use case matters a lot. The resulting single pack would have much worse object density, compared to the case where you add them normally, initially creating loose object files and then repack/gc at which time you are likely to have more than one rev to sanely deltify.

Using one pack per large object while creating is not too bad to begin with. If you had a large enough core to hold such a large binary file, the current system would store it as a single loose object file, so it is not like we are making things any worse. In either form, these "single object per a file" initial storage will find their more permanent home upon the first repack/gc.

Previous: Junio C HamanoNext: Ævar Arnfjörð Bjarmason
Message 16 of 18 in “git add a-Big-file”
  1. 0/3 git add a-Big-fileJunio C Hamano, May 8, 2011
  2. 1/3 index_fd(): turn write_object and format_check arguments into one flagJunio C Hamano, May 8, 2011
  3. 2/3 index_fd(): split into two helper functionsJunio C Hamano, May 8, 2011
  4. 3/3 Bigfile: teach "git add" to send a large file straight to a packJunio C Hamano, May 8, 2011
  5. Nguyen Thai Ngoc DuyMay 8, 2011
  6. Junio C HamanoMay 8, 2011
  7. 0/4 convert.c clean-upJunio C Hamano, May 9, 2011
  8. 1/4 convert: rename the "eol" global variable to "core_eol"Junio C Hamano, May 9, 2011
  9. 2/4 convert: give saner names to crlf/eol variables, types and functionsJunio C Hamano, May 9, 2011
  10. 3/4 convert: make it safer to add conversion attributesJunio C Hamano, May 9, 2011
  11. 4/4 convert: make it harder to screw up adding a conversion attributeJunio C Hamano, May 9, 2011
  12. Nguyen Thai Ngoc DuyMay 10, 2011
  13. Junio C HamanoMay 10, 2011
  14. Shawn PearceMay 9, 2011
  15. Junio C HamanoMay 9, 2011
  16. Junio C HamanoMay 9, 2011
  17. Ævar Arnfjörð BjarmasonMay 29, 2011
  18. Junio C HamanoMay 29, 2011

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.