From: Jan Harkes Date: Mon, 30 Oct 2006 21:07:51 GMT Subject: Re: WARNING: THIS PATCH CAN BREAK YOUR REPO, was Re: [PATCH 2/3] Only repack active packs by skipping over kept packs. Message-ID: <20061030210751.GB20236@delft.aura.cs.cmu.edu> In-Reply-To: <20061030205200.GA20236@delft.aura.cs.cmu.edu> On Mon, Oct 30, 2006 at 03:52:00PM -0500, Jan Harkes wrote: > On Mon, Oct 30, 2006 at 03:26:11PM -0500, Shawn Pearce wrote: > > Do the above so you have everything in one pack. Now use rev-list > > to simulate the object list construction in pack-objects as though > > we were doing a 'git repack -a -d': > > > > git-rev-list --objects --all \ > > --unpacked=.git/objects/pack/pack-*.pack \ > > | wc -l > > > > gives me 102 (WRONG WRONG WRONG WRONG!!!!!!) > ... > > The following patch does fix the problem Nicolas reported, but for some > reason I'm still getting only 102 objects (only tags and the commits > they refer to?) with your test. Seems to be operator error, I guess the shell can't (won't) expand --unpacked=.git/objects/pack/pack-*.pack and there is no pack named pack-*.pack, so rev-list will actually find every object in one of the packs and skip them. The following works correctly, $ git-rev-list --objects --all --unpacked=.git/objects/pack/pack-234f8136e45fb34d118bb346c15267535e80e5f0.pack --unpacked=.git/objects/pack/pack-aceb4c6394c586abaf65d76dd6cf088f50a5b806.pack | wc -l 28713 $ ~/git/git/git-rev-list --objects --all | wc -l 28713 Jan