Skip to content

Should set maintenance.auto = false instead of (or in addition to) gc.auto = 0 #2437

@anomiex

Description

@anomiex

Request

The action currently sets gc.auto to 0 to disable automatic garbage collection in two places

['config', '--local', 'gc.auto', '0'],

'git config --local gc.auto 0',

Git version 2.54.0 changed the default garbage collection strategy from "gc" to "geometric" (git/git@50d7425), so gc.auto no longer has any effect. The new configuration setting is maintenance.auto.

If you want to continue supporting runs inside containers with very old versions of git (looks like pre-2.30), you could continue setting gc.auto in addition to maintenance.auto.

Background

Recently we started running into a strange intermittent error in some of our workflows that do git checkout --deepen to get the merge-base of the PR for certain analysis.

fatal: shallow file has changed since we read it

It turns out that the automatic garbage collection spawned as a background process from one command was changing the shallow file after the subsequent git checkout --deepen had already started running. We didn't have this problem with 2.53 and earlier because of the gc.auto = 0 setting, but 2.54.0's change away from gc as the default garbage collection made that ineffective.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions