From 3a43e056bd2f134d60be1d8e99b9fc2b360e1be2 Mon Sep 17 00:00:00 2001 From: Karthik Nayak Date: Tue, 2 Apr 2024 13:15:04 +0200 Subject: [PATCH] git: Add config to disable all advice By setting "advice.*" to "false", we disable all Git advice. The advice provided by Git, is useful for end users, whereas doesn't make much sense on the server side. Plus being on the user side of things, it is more susceptible to change, which can break our pipelines since we test error strings output by Git. --- internal/git/command_factory.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/internal/git/command_factory.go b/internal/git/command_factory.go index 6bca65ff3c..d0c6036144 100644 --- a/internal/git/command_factory.go +++ b/internal/git/command_factory.go @@ -610,12 +610,8 @@ func (cf *ExecCommandFactory) GlobalConfiguration(ctx context.Context) ([]Config // `WithReftxHook()`. // 4. Configuration as provided by the admin in Gitaly's config.toml. config := []ConfigPair{ - // Disable automatic garbage collection as we handle scheduling - // of it ourselves. - {Key: "gc.auto", Value: "0"}, - - // Disable automatic maintenance as we never enable any tasks. - {Key: "maintenance.auto", Value: "0"}, + // Disable all advice strings since they're bound to change. + {Key: "advice.*", Value: "false"}, // CRLF line endings will get replaced with LF line endings when writing blobs to the // object database. No conversion is done when reading blobs from the object database. @@ -675,6 +671,13 @@ func (cf *ExecCommandFactory) GlobalConfiguration(ctx context.Context) ([]Config // packfile window anyway while it should on the other hand lead to lower memory consumption and faster // computation of diffs when large blobs are involved. {Key: "core.bigFileThreshold", Value: fmt.Sprintf("%dm", BigFileThresholdMB)}, + + // Disable automatic garbage collection as we handle scheduling + // of it ourselves. + {Key: "gc.auto", Value: "0"}, + + // Disable automatic maintenance as we never enable any tasks. + {Key: "maintenance.auto", Value: "0"}, } return config, nil -- GitLab