git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: linux@horizon.com
Cc: git@vger.kernel.org, junkio@cox.net
Subject: Re: [PATCH] git-repack question
Date: Fri, 17 Feb 2006 14:20:40 -0800 (PST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0602171414220.916@g5.osdl.org> (raw)
In-Reply-To: <20060217213824.5848.qmail@science.horizon.com>



On Fri, 17 Feb 2006, linux@horizon.com wrote:
>
> I'm trying to imagine when you'd want to run git-repack without the -d
> option, or without running git-prune-packed afterwards.
> (Isn't the idea behind packs to save space?)

Normally you'd always run git-prune-packed.

The reason it doesn't do that is simply being anally careful, and because 
conceptually the pruning phase is totally independent.

For example, in an environment that mirrors out git repositories by rsync, 
it can make sense to wait with pruning until the mirror cycle has 
finished, so that all mirrors always have all the objects.

(I don't do it for the kernel, because (a) I'm a lazy bastard, (b) I'm so 
confused that I sometimes forget my own name, much less to prune things a 
day after I've repacked them and (c) I don't care that much about rsync 
anyway, since you can't avoid some of the _other_ races).

As to whether you'd normally run "-d" - usually you'd run it whenever you 
pair it up with "-a". When you do an incremental re-pack, "-d" won't do 
anything anyway.

Again, it might make sense to not delete the old packs when repacking 
everything in a rsync'ing environment - or even in a shared repository, 
where removing a pack-file could race with somebody else working on it.

Basically, the default ends up being to never remove any objects at all, 
simply because that's the _safe_ thing to do.

In practice, I personally always do

	git repack -a -d
	git prune-packed

together, because the full repack isn't _that_ expensive for me (I tend to 
have lots of cpu power), and because I can't be bothered to worry too much 
about rsync and there are never any other users working on my git trees.

		Linus

  reply	other threads:[~2006-02-17 22:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-17 21:38 [PATCH] git-repack question linux
2006-02-17 22:20 ` Linus Torvalds [this message]
2006-02-18  6:50 ` 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.0602171414220.916@g5.osdl.org \
    --to=torvalds@osdl.org \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=linux@horizon.com \
    /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).