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

Re: [PATCH] Support 64-bit indexes for pack files.

From
GBGeert Bosch <bosch@adacore.com>
Date
Feb 27, 2007, 16:55 UTC
Message-ID
<2BBADC5E-7188-4F77-BF5A-28131B435EF0@adacore.com>
In-Reply-To
<20070227161122.GE3230@spearce.org>
On Feb 27, 2007, at 11:11, Shawn O. Pearce wrote:
Show 8 quoted lines
> Geert Bosch <bosch@adacore.com> wrote:
>> When I import a large code-base (such as a *.tar.gz), I don't know
>> beforehand how many objects I'm going to create. Ideally, I'd like
>> to stream them directly into a new pack without ever having to write
>> the expanded source to the filesystem.
>
> See git-fast-import.  If you are coming from a tar, also see
> contrib/fast-import/import-tars.perl.  :-)

Yes, I saw that, really nice. I had written something myself to create pack files from a streaming data source. Basically, I'm breaking arbitrary data-streams (mostly backups) into chunks along content-defined boundaries and then link the chunks together in a tree. This eliminates any duplicate files, and even chunks of larger files that are identical. I create new pack files whenever the old one gets larger than a certain predefined size (128 MB, currently).

I'm happy I can base this on git-fast-import now.
Show 10 quoted lines
>> So for creating a large pack from a stream of data, you have to do
>> the following:
>>   1. write out a temporary pack file to disk without correct count
>>   2. fix-up the count
>>   3. read the entire temporary pack file to compute the final SHA-1
>>   4. fix-up the SHA1 at the end of the file
>>   5. construct and write out the index
>
> Yes, this is exactly what git-fast-import does.  Yes, it sort of
> sucks.  But its not as bad as you think.

For smaller packs, the I/O is all going to be buffered anyway, but if we're going to have >4GB pack files, it adds a lot of real I/O and SHA1 computation for no good reason. If we get a rare chance to have a new pack format, why not fix this wart at the same time?

   -Geert
Previous: Shawn O. PearceNext: Nicolas Pitre
Message 10 of 20 in “Support 64-bit indexes for pack files.”
  1. Support 64-bit indexes for pack files.Troy Telford, Feb 26, 2007
  2. Shawn O. PearceFeb 26, 2007
  3. Nicolas PitreFeb 27, 2007
  4. Shawn O. PearceFeb 27, 2007
  5. Nicolas PitreFeb 27, 2007
  6. Geert BoschFeb 27, 2007
  7. Nicolas PitreFeb 27, 2007
  8. Geert BoschFeb 27, 2007
  9. Shawn O. PearceFeb 27, 2007
  10. Geert BoschFeb 27, 2007
  11. Nicolas PitreFeb 27, 2007
  12. Shawn O. PearceFeb 28, 2007
  13. Nicolas PitreFeb 28, 2007
  14. Nicolas PitreFeb 27, 2007
  15. Johannes SchindelinFeb 27, 2007
  16. Geert BoschFeb 27, 2007
  17. Johannes SchindelinFeb 27, 2007
  18. Troy TelfordFeb 27, 2007
  19. Nicolas PitreFeb 27, 2007
  20. Troy TelfordFeb 28, 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.