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

Re: fast-import and unique objects.

From
Jon Smirl <jonsmirl@gmail.com>
Date
Aug 8, 2006, 23:56 UTC
Message-ID
<9e4733910608081656p4bcd68d9xb3e60b58d9afbcc9@mail.gmail.com>
In-Reply-To
<20060808224537.GB18163@spearce.org>
On 8/8/06, Shawn Pearce <spearce@spearce.org> wrote:
Show 52 quoted lines
> Jon Smirl <jonsmirl@gmail.com> wrote:
> > We're designing a dumpfile format for git like the one SVN has.
>
> I'm not sure I'd call it a dumpfile format.  More like an importfile
> format.  Reading a GIT pack is really pretty trivial; if someone was
> going to write a parser/reader to pull apart a GIT repository and
> use that information in another way they would just do it against
> the pack files.  Its really not that much code.  But generating a
> pack efficiently for a large volume of data is slightly less trivial;
> the attempt here is to produce some tool that can take a relatively
> trivial data stream and produce a reasonable (but not necessarily
> absolute smallest) pack from it in the least amount of CPU and
> disk time necessary to do the job.  I would hope that nobody would
> seriously consider dumping a GIT repository back INTO this format!
>
> [snip]
> > AFAIK the svn code doesn't do merge commits. We probably need a post
> > processing pass in the git repo that finds the merges and closes off
> > the branches. gitk won't be pretty with 1,500 open branches. This may
> > need some manual clues.
>
> *wince* 1500 open branches.  Youch.  OK, that answers a lot of
> questions for me with regards to memory handling in fast-import.
> Which you provide excellent suggestions for below.  I guess I didn't
> think you had nearly that many...
>
> [snip]
> > The file names are used over and over. Alloc a giant chunk of memory
> > and keep appending the file name strings to it. Then build a little
> > tree so that you can look up existing names. i.e. turn the files names
> > into atoms. Never delete anything.
>
> Agreed.  For 1500 branches its worth doing.
>
> [snip]
> > About 100,000 files in the initial change set that builds the repo.
> > FInal repo has 120,000 files.
> >
> > There are 1,500 branches. I haven't looked at the svn dump file format
> > for branches, but I suspect that it sends everything on a branch out
> > at once and doesn't intersperse it with the trunk commits.
>
> If you can tell fast-import your are completely done processing a
> branch I can recycle the memory I have tied up for that branch; but
> if that's going to be difficult then...  hmm.
>
> Right now I'm looking at around 5 MB/branch, based on implementing
> the memory handling optimizations you suggested.  That's still *huge*
> for 1500 branches.  I clearly can't hang onto every branch in memory
> for the entire life of the import like I was planning on doing.
> I'll kick that around for a couple of hours and see what I come
> up with.

Some of these branches are what cvs2svn calls unlabeled branches. cvs2svn is probably creating more of these than necessary since the code for coalescing them into a single big unlabeled branch is not that good.

I attached the list of branch names being generated.
>
> --
> Shawn.
>
-- 
Jon Smirl
jonsmirl@gmail.com
Previous: Shawn PearceNext: Martin Langhoff
Message 12 of 15 in “fast-import and unique objects.”
  1. Jon SmirlAug 6, 2006
  2. Jon SmirlAug 6, 2006
  3. Shawn PearceAug 6, 2006
  4. Jon SmirlAug 7, 2006
  5. Shawn PearceAug 7, 2006
  6. Jon SmirlAug 7, 2006
  7. Jakub NarebskiAug 7, 2006
  8. Jon SmirlAug 7, 2006
  9. Shawn PearceAug 8, 2006
  10. Jon SmirlAug 8, 2006
  11. Shawn PearceAug 8, 2006
  12. Jon SmirlAug 8, 2006
  13. Martin LanghoffAug 7, 2006
  14. Ryan AndersonAug 7, 2006
  15. Shawn PearceAug 7, 2006

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.