On Mon, Oct 25, 2021 at 11:38:51AM -0400, Tom Lane wrote:
> Andrew Dunstan <and...@dunslane.net> writes:
> > On 10/25/21 10:23, Tom Lane wrote:
> >> (Hmmm ... but disk space could
> >> become a problem, particularly on older machines with not so much
> >> disk.  Do we really need to maintain a separate checkout for each
> >> branch?  It seems like a fresh checkout from the repo would be
> >> little more expensive than the current copy-a-checkout process.)
> 
> > If you set it up with these settings then the disk space used is minimal:
> >      git_use_workdirs => 1,
> >      rm_worktrees => 1,
> 
> Maybe we should make those the defaults?  AFAICS the current
> default setup uses circa 200MB per back branch, even between runs.
> I'm not sure what that is buying us.

Maybe git's shared/"alternates" would be helpful to minimize the size of
.git/objects?

I'm not sure - it looks like the BF client does its own stuff with symlinks.
Is that for compatibility with old git ?
https://github.com/PGBuildFarm/client-code/blob/main/PGBuild/SCM.pm

If you "clone" a local location, it uses hard links by default.
If you use --shared or --reference, then it uses references to the configured
"alternates", if any.

In both cases, .git/objects requires no additional space (but the "checked out"
copy still takes up however much space).

$ mkdir tmp
$ git clone --quiet ./postgresql tmp/pg
$ du -sh tmp/pg
492M    tmp/pg

$ rm -fr tmp/pg
$ git clone --quiet --shared ./postgresql tmp/pg
$ du -sh tmp/pg
124M    tmp/pg

-- 
Justin


Reply via email to