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.
Request
The action currently sets
gc.autoto 0 to disable automatic garbage collection in two placescheckout/src/git-command-manager.ts
Line 515 in 900f221
checkout/src/git-source-provider.ts
Line 269 in 900f221
Git version 2.54.0 changed the default garbage collection strategy from "gc" to "geometric" (git/git@50d7425), so
gc.autono longer has any effect. The new configuration setting ismaintenance.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.autoin addition tomaintenance.auto.Background
Recently we started running into a strange intermittent error in some of our workflows that do
git checkout --deepento get the merge-base of the PR for certain analysis.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 --deepenhad already started running. We didn't have this problem with 2.53 and earlier because of thegc.auto = 0setting, but 2.54.0's change away fromgcas the default garbage collection made that ineffective.