git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Hosting Git repositories: how useful will git-gc be?
@ 2009-09-03  9:45 Matthieu Moy
  2009-09-05  6:24 ` Jeff King
  0 siblings, 1 reply; 2+ messages in thread
From: Matthieu Moy @ 2009-09-03  9:45 UTC (permalink / raw)
  To: git

Hi,

I'm helping my sysadmin to set up some Git repository hosting via
gitosis. I'm trying to keep it as simple as possible.

A question: is it necessary/recommanded/useless to set up a cron job
doing a "git gc" in each repository? My understanding is that a push
through ssh will do some packing, is it correct? Does receiving a pack
trigger a "git gc --auto"?

Thanks,

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Hosting Git repositories: how useful will git-gc be?
  2009-09-03  9:45 Hosting Git repositories: how useful will git-gc be? Matthieu Moy
@ 2009-09-05  6:24 ` Jeff King
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff King @ 2009-09-05  6:24 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git

On Thu, Sep 03, 2009 at 11:45:25AM +0200, Matthieu Moy wrote:

> A question: is it necessary/recommanded/useless to set up a cron job
> doing a "git gc" in each repository? My understanding is that a push
> through ssh will do some packing, is it correct? Does receiving a pack
> trigger a "git gc --auto"?

The objects are transferred as a pack. If the number of objects is less
than receive.unpackLimit (default 100), then they are unpacked to loose
objects. If more, we keep the pack, after completing any missing deltas
used by a thin pack.

So if you tend to push frequently, you will end up with a lot of loose
objects. Even if you have packs, they will be larger than necessary
because you will be missing deltas between objects across packs. And of
course you will eventually end up with a large number of packs, which is
less efficient (each pack has an index, but I believe we search the
indices linearly).

Receiving a pack does not (AFAICT looking at the code) trigger a "gc
--auto".  Running it has other benefits, too, like pruning cruft and
packing refs. So I think it is probably a good idea to run it
periodically.

Running it daily or weekly is probably reasonable. You could run it on
every push using the post-update hook, but that may cause excessive I/O
for very little benefit.

-Peff

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-05  6:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-03  9:45 Hosting Git repositories: how useful will git-gc be? Matthieu Moy
2009-09-05  6:24 ` Jeff King

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