Skip to content

Add git-maintenance recommendation diagnostic to doctor

What does this merge request do and why?

This MR adds a diagnostic that encourages developers to enable git maintenance if it is not enabled for the local clones of gitlab-org/gitlab-development-kit> and gitlab-org/gitlab>.

If you don’t enable git maintenance or run git gc --auto every so often, you repository might get to a state where git operations like fetch, pull, or checkout will take over ten times longer than necessary.

Note: we already merged Speed up git fetch of gitlab-org/gitlab during ... (!3819 - merged), which speeds up gdk update in situations like above but git maintenance is a better and more complete fix.

How to set up and validate locally

  1. Check that the GDK or gitlab-org/gitlab> repos aren’t included in git config --get-all --global maintenance.repo, remove one or both if they are
  2. Run gdk doctor
  3. See the git-maintenance recommendation to keep your local repos fast
  4. Run git maintenance start in the local repos
  5. Run gdk doctor again
  6. See no recommendation anymore 🎉

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • Announcement added, if change is notable.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.

Merge request reports