From 0316baf726180233ae80b1281bdcdfa25e832aab Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Tue, 26 Oct 2010 19:26:31 +0530 Subject: [PATCH] mirror code learns receive.fsckObjects --- doc/mirroring.mkd | 20 ++++++++++++++++++++ hooks/common/post-receive.mirrorpush | 1 + 2 files changed, 21 insertions(+) diff --git a/doc/mirroring.mkd b/doc/mirroring.mkd index 382f95f..7b18e01 100644 --- a/doc/mirroring.mkd +++ b/doc/mirroring.mkd @@ -31,6 +31,7 @@ In this document: * setup the mirror-shell on each server * set slaves to slave mode * set slave server lists + * efficiency versus paranoia * syncing the mirrors the first time * switching over * the return of foo @@ -181,6 +182,25 @@ port number: And that's really all there is, unless... + + +### efficiency versus paranoia + +If you're paranoid enough to use mirrors, you should be paranoid enough to +like the `receive.fsckObjects` setting we now default to :-) However, informal +tests indicate a 40-50% CPU overhead from this. If you don't like that, +remove that line from the post-receive code. + +Please also note that we only set it on mirrors, and that too at the time the +mirrored repo is *created*. This means, when you start using your old "main" +server as a mirror (see later sections on switching over to a mirror, etc.), +it's repos do not have this setting. Repos created by previous versions of +gitolite also will not have this setting. + +Personally, I just set `git config --global receive.fsckObjects true`, since +those servers aren't doing anything else anyway, and are idle for long +stretches of time. It's upto you what you want to do here. + ### syncing the mirrors the first time diff --git a/hooks/common/post-receive.mirrorpush b/hooks/common/post-receive.mirrorpush index 5188236..dd04425 100755 --- a/hooks/common/post-receive.mirrorpush +++ b/hooks/common/post-receive.mirrorpush @@ -14,6 +14,7 @@ then else ssh $mirror mkdir -p $GL_REPO.git ssh $mirror git init --bare $GL_REPO.git + ssh $mirror git config receive.fsckObjects true git push --mirror $mirror:$GL_REPO.git || echo "WARNING: mirror push to $mirror failed" fi