Re: Git and buildworld running at the same time

From: Chris Torek <chris.torek_at_gmail.com>
Date: Sun, 14 Sep 2025 00:51:03 UTC
On Sat, Sep 13, 2025 at 7:57 AM bob prohaska <fbsd@www.zefox.net> wrote:

> Lately I've noticed that sometimes while running buildworld a top
> window reports git running also. Up to now, I've surmised that
> this is intentional, with git providing some housekeeping function. ...


Git has its own housekeeping systems, including automatically
re-packing repositories after a fetch (remember that `git pull` is
nearly equivalent to `git fetch` followed by `git merge`). So this is
likely normal Git behavior.

Since the mid to late 2.40 versions of Git, "git maintenance" has
more or less taken over as the "proper" driver for this kind of
maintenance work, but since the Git folks do take compatibility
quite seriously, "git gc" still does what it used to do and you can
still use it (automatically or manually). Still, you might want to read
the "git maintenance" manual page and set up a cron job to
pre-fetch and pre-repack repositories. This should also make
your merge operations [1] more convenient.

Chris

[1] "git pull" that is, though I personally avoid "git pull" and *always*
run a separate fetch step anyway. This is partly for historical reasons
dating back to Git 1.5, but I like to run a `git log` in between to
look at the incoming commits. I use an alias, `git lin`, for "log
incoming":

    [alias]
        lin = log ..@{u}

Note that if you choose to use the new maintenance system,
you must still run a separate `git fetch` anyway, so as to update
the remote-tracking refs (`remote/origin/main` etc). It just tends
to go far faster since you will already have the objects downloaded.