Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jan 2021 16:47:55 +0100
From:      Ulrich =?utf-8?B?U3DDtnJsZWlu?= <uqs@freebsd.org>
To:        Pete French <petefrench@ingresso.co.uk>
Cc:        FreeBSD Stable Mailing List <freebsd-stable@freebsd.org>
Subject:   Re: How to handle the pack files now we have switched to git?
Message-ID:  <X/Xbq/fTKHMXUX82@acme.spoerlein.net>
In-Reply-To: <22d067ae-c204-0dc5-4195-2d1c07f35560@ingresso.co.uk>
References:  <22d067ae-c204-0dc5-4195-2d1c07f35560@ingresso.co.uk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2021-01-05 at 11:08:48 +0000, Pete French wrote:
>So, for me the switch to git went very smoothly. I havent moved to
>etcupdate yet, but will probably do that soon. Hopwever I did hit one
>issue. What I do is to build on a single machine, and then send that to
>a number of places using rsync.
>
>But what seems to happen wuth git is that it has a big pack file of
>objects, and the name of the opack file is the SHA1 of whatever is
>inside it. So if something chnages then the filename chnages - and thus
>rsync tries to move the entire lot all over again, even if the change is
>tiny.

That's not entirely correct. The packfile will only be rewritten if
a) enough other stuff has accumulated
b) you force a repack.

You are fighting against git's GC mechanism a bit here, but you can 
still make it work. On your source of truth host, do the following:

1. git gc --aggressive
2. look at .git/objects/pack, there should be a single big pack
3. touch .git/objects/pack/pack-<whateverhash>.keep  (or was it .pack.keep?)
4. rsync --del to all other hosts

Now future git gc runs will not delete that big pack, you'll only get 
churn in the new, much smaller, packs.

hth
Uli



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?X/Xbq/fTKHMXUX82>