git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@cam.org>
To: Shawn Pearce <spearce@spearce.org>
Cc: Junio C Hamano <junkio@cox.net>, git@vger.kernel.org
Subject: WARNING: THIS PATCH CAN BREAK YOUR REPO, was Re: [PATCH 2/3] Only repack active packs by skipping over kept packs.
Date: Mon, 30 Oct 2006 14:07:57 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0610301332440.11384@xanadu.home> (raw)
In-Reply-To: <20061029093754.GD3847@spearce.org>

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

So far everything should be fine.  It's still time to make a backup copy 
of your .git directory if you've not done so.

Now let's create a second pack containing a subset of the existing one.

$ git-rev-list --objects v1.4.3..v1.4.3.3 | \
  git-pack-objects --stdout | \
  git-index-pack --stdin -v --keep
$ git-fsck-objects --full

At this point the repository is still fine, but the --keep to 
git-index-pack above will have created a file called 
.git/objects/pack/pack-aceb4c6394c586abaf65d76dd6cf088f50a5b806.keep and 
that is the source of all the trouble to come.  You still can remove 
that file if you don't have a backup yet.

If you still want to give it the coup de grace, just do:

$ git-repack -a -d

And now you've just lost a large amount of objects.  To see the extent 
of the dammage, just do:

$ git-fsck-objects

So... what is the --unpacked=<pack>.pack switch supposed to mean?  It is 
not documented anywhere and it certainly doesn't produce the expected 
result with a repack.



  reply	other threads:[~2006-10-30 19:08 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-29  9:37 [PATCH 2/3] Only repack active packs by skipping over kept packs Shawn Pearce
2006-10-30 19:07 ` Nicolas Pitre [this message]
2006-10-30 19:23   ` WARNING: THIS PATCH CAN BREAK YOUR REPO, was " Shawn Pearce
2006-10-30 20:26   ` Shawn Pearce
2006-10-30 20:52     ` Jan Harkes
2006-10-30 21:07       ` Jan Harkes
2006-10-30 21:09       ` Shawn Pearce
2006-10-30 21:59       ` Junio C Hamano
2006-10-30 22:54         ` Junio C Hamano
2006-10-30 22:55         ` Jan Harkes
2006-10-30 23:24           ` Junio C Hamano
2006-10-31  1:37             ` [PATCH] Continue traversal when rev-list --unpacked finds a packed commit Jan Harkes
2006-10-31  1:47               ` Junio C Hamano
2006-10-31  2:17                 ` Jan Harkes
2006-10-30 21:48     ` WARNING: THIS PATCH CAN BREAK YOUR REPO, was Re: [PATCH 2/3] Only repack active packs by skipping over kept packs Junio C Hamano
2006-10-30 21:55       ` Shawn Pearce
2006-10-30 22:07         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0610301332440.11384@xanadu.home \
    --to=nico@cam.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).