Does Bazaar acrete garbage

John Arbash Meinel john at arbash-meinel.com
Thu Sep 4 16:07:31 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> On Thu, 2008-09-04 at 07:39 +0100, Russel Winder wrote:
...

>> As any Git user knows it behoves one to run "git gc" from time to
>> time,
>> since Git accretes garbage.  In many situations doing the garbage
>> collect can halve the disk space used.  Does Bazaar suffer the same
>> effect as Git?  If it does what is the official policy for getting rid
>> of garbage?
> 
> We intend to have a gc command at some future point, to handle cleanups
> after uncommit, or branch deletion. When its written I intend to try and
> ensure it is rarely needed - I don't think users should have to worry
> about such details on a regular basis.
> 
> -Rob
> 

I think there are a few ways that Git accretes garbage, mostly because
it stores things in the repository at "add" time, rather than at
"commit" time. (Part of how it handles the index, etc.)

Basically, that means that whenever you update git's index, it stores
more data into the repository, which may never be committed (and is thus
cleaned out during gc).

Further, if I understand git's repository layout correctly, these little
bits are stored as just gzip compressed fulltexts. (So doing 'git add
foo' takes the current text of foo, gzips it, computes the sha hash, and
puts it in the repository as such.)

When you later to "git (re?)pack" it will find entries that are
referenced, and computes deltas, etc to make them smaller. I don't know
what it does for unreferenced entries, it might also put them into the
pack file.

Regardless, because whenever you update with 'git add', it stores new
snapshots, those are all cruft. Bazaar only adds new texts to the
repository at 'commit' time (and merge/pull, but that is separate).
Also, Bazaar will delta at commit time, making explicit packing less
necessary. (There are still reasons to do so from time to time, but
storage bloat isn't really one of them.)

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAki/+bMACgkQJdeBCYSNAAMWPgCgiYLuFbsqb17PHnVJdoLLzHpp
SU0An1xAFWk33qrPHhwVCck+jlawIXW9
=uc9B
-----END PGP SIGNATURE-----



More information about the bazaar mailing list