Speeding up slower Git operations

Ilya Bakulin ilya at bakulin.de
Tue May 28 17:57:35 UTC 2019

You are counting commits behind HEAD which is a mere pointer to the current
branch head. So if you are working on some "topic" branch then the number
becomes effectively useless since it will count a number of commits behind
that topic branch HEAD. So this number alone is not sufficient unless you
also append "-dirty" or something else to denote the "canonical" build done
from a clean git checkout of the official FreeBSD repository. Which is a
good idea anyway, I guess.
So that when somebody reports a bug on some mailing list and includes a
kernel version number (or freebsd-version output) it's immediately obvious
that they are using a non-official kernel.

On Tue, May 28, 2019 at 3:43 PM Ed Maste <emaste at freebsd.org> wrote:

> Microsoft has been putting a lot of work into improving git
> performance and scalability with large repositories. A recent
> development is the addition of the commit-graph feature[1], which
> caches information about the commit graph and speeds up operations
> like determining if a commit is on a specified branch, or obtaining
> the commit count.
> As an example of the performance gain, the feature's developer reports
> that a "git branch --contains" on the Linux kernel went from 76.20s to
> 0.04s. In my FreeBSD tree "git rev-list HEAD --count" went from an
> average of 2.77s wall clock to 0.39s. This operation (rev-list
> --count) is interesting as it can serve as a replacement for
> monotonically increasing version numbers, and with it executing in
> under half a second it seems like it'd be reasonable to add it to
> newvers.sh (to bake into uname).
> To enable the feature, enable the commitGraph option:
> % git config core.commitGraph true
> Then populate the commit graph:
> % git commit-graph write --reachable
> If you try it please reply and let us know how it worked for you.
> [1]
> https://devblogs.microsoft.com/devops/supercharging-the-git-commit-graph/
> _______________________________________________
> freebsd-git at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-git
> To unsubscribe, send any mail to "freebsd-git-unsubscribe at freebsd.org"

More information about the freebsd-git mailing list