Re: git-fast-export hg mutt (24M vs 184M)
- From
Shawn O. Pearce <spearce@spearce.org>
- Date
- May 3, 2007, 21:18 UTC
- Message-ID
- <20070503211824.GB16538@spearce.org>
- In-Reply-To
- <20070503210112.GE3260@artemis>
Pierre Habouzit <madcoder@debian.org> wrote:
Show 6 quoted lines
> On Thu, May 03, 2007 at 09:17:16PM +0200, Thomas Glanzmann wrote: > > Hello, > > git-repack -a -d -f got it down to 19M. I missed the -f parameter > > before. Sorry for the noise. > > You may want to use git gc that does that (and a bit more) for you.
Actually, in this case, no.
git-gc by default doesn't use the -f option. -f to git-repack means "no reuse deltas". That particular feature of git-repack is basically required to be used after running git-fast-import with anything sizeable.
The reason you need -f is git-fast-import does not write optimally compressed blobs (file revisions) when it creates the packfile. Instead it does a reasonable best effort while using a minimum amount of memory. The Git packfiles get most of their compression benefits from being able to see all of a project's data at once; this is impossible in fast-import as we're only seeing a small part of the incoming data stream at any single point in time.
If you had a lot of tags imported you might want to also use `git pack-refs` (one of the chores that git-gc does), or `git pack-refs --all` if you have a lot of dangling branches imported. The other chores in git-gc aren't actually useful after running fast-import (reflog expire, prune, rerere gc).
-- Shawn.