git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: Sam Vilain <sam@vilain.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] repack: allow simultaneous packing and pruning
Date: Tue, 10 Oct 2006 08:03:54 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.64.0610100800490.3952@g5.osdl.org> (raw)
In-Reply-To: <20061010102210.568341380D6@magnus.utsl.gen.nz>



On Tue, 10 Oct 2006, Sam Vilain wrote:
>
> If using git-repack -a, unreferenced objects are kept behind in the
> pack.  This might be the best default, but there are no good ways
> to clean up the packfiles if a lot of rebasing is happening, or
> branches have been deleted.

Don't do this.

I understand why you want to do it, but the fact is, it's dangerous.

Right now, "git repack" is actually safe to run even on a repository which 
is being modified! And that's actually important, if you have something 
like a shared repo that gets re-packed every once in a while from a 
cron-job!

So the refs might be up-dated as it runs, and if that happens, your 
pruning doesn't really do the right thing - it might consider a new loose 
object to be unreachable, because it didn't check whether the refs have 
changed since it read them so that it might actually _be_ reachable after 
all.

So please don't do this. 

It's important for operations to always think about "what happens if 
somebody does a 'commit' or pushes into the tree at the same time?".

For example, the "git prune-packed" that gets run afterwards is _not_ 
racy, because it will only prune objects that already exist in the pack.

		Linus

  parent reply	other threads:[~2006-10-10 15:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-10 10:14 [PATCH] repack: allow simultaneous packing and pruning Sam Vilain
2006-10-10 11:04 ` Sam Vilain
2006-10-10 15:03 ` Linus Torvalds [this message]
2006-10-10 19:46   ` Eran Tromer
2006-10-10 21:25     ` Linus Torvalds
2006-10-10 22:09       ` Eran Tromer
2006-10-10 22:27         ` Linus Torvalds
2006-10-10 23:45           ` Eran Tromer
2006-10-10 20:24   ` 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.0610100800490.3952@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=sam@vilain.net \
    /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).