Skip to content

housekeeping: Improve cleanup of the gitconfig

Patrick Steinhardt requested to merge pks-housekeeping-fix-config-cleanup into master

This MR fixes two issues with the gitconfig cleanup: first, we had a typo and thus didn't cleanup up "remote.*.prune" config keys as expected. And second we left behind empty config sections in the past, which had led to gitconfigs found in production which were tens of thousands of lines long. This heavily impacts performance for short-running Git commands, up to a point where they're completely dominated by the time to parse the gitconfig (see e.g. the second flame graph in https://gitlab.com/gitlab-org/gitaly/-/issues/2436#note_821525169).

Merge request reports