Subject: Re: WARNING: THIS PATCH CAN BREAK YOUR REPO, was Re: [PATCH 2/3] Only repack active packs by skipping over kept packs.

From: Shawn Pearce <[email-masked]>
Date: Mon, 30 Oct 2006 15:26:11 -0500

Nicolas Pitre <[email-masked]> wrote:
> On Sun, 29 Oct 2006, Shawn Pearce wrote:
> 
> > During `git repack -a -d` only repack objects which are loose or
> > which reside in an active (a non-kept) pack.  This allows the user
> > to keep large packs as-is without continuous repacking and can be
> > very helpful on large repositories.
> 
> Something is really broken here.
> 
> Here's how to destroy your GIT's git repository.
> 
> WARNING: MAKE A COPY BEFORE TRYING THIS!  I'm serious.
> 
> First, let's make a single pack just to make things simpler and 
> reproducible:
> 
> $ git-repack -a -f -d
> $ git-prune
> $ git-fsck-objects --full

Actually the breakage is easier to reproduce without trashing
a repository.

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!!!!!!)

and
 
  git-rev-list --objects --all | wc -l

gives me 31912 (correct).  The --unpacked flag is horribly broken.

--