Add git-maintenance recommendation diagnostic to gdk 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
- 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 - Run
gdk doctor
- See the
git-maintenance
recommendation to keep your local repos fast - Run
git maintenance start
in the local repos - Run
gdk doctor
again - See no recommendation anymore
🎉
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
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 theCHANGELOG.md
.