From: Brandon Casey Date: Wed, 13 Jun 2007 23:07:29 GMT Subject: Re: clarify git clone --local --shared --reference Message-ID: <467078B1.8080104@nrlssc.navy.mil> In-Reply-To: <20070608053750.GB18521@spearce.org> Shawn O. Pearce wrote: > Brandon Casey wrote: >> The docs (git-repack.txt) seem to suggest that git-repack (without -d) >> does not delete any objects. And if -d is used, then at most objects >> already referenced in other packs will be deleted. This makes me think >> that repack is safe on the source repository. > > You are correct that leaving off the '-d' won't delete objects. > But a pack is created by listing the objects we need, and if we don't > need the object in source, we don't include it into the new pack. > > -a -d implies delete all packs that existed when we started the > repack. So if an object was in the old packfile, and we didn't > copy it to the new packfile, it gets deleted. ;-) Ok. There is the connection I did not make. repack -d is NOT harmless, since a pack that contains only objects referenced in other packs and dangling unreferenced objects, will be deleted. Which will be all of the preexisting packs in the case of git-gc since as you mentioned it repacks using -a -d -l. Thanks for taking the time. -brandon