diff options
author | Karthik Nayak <knayak@gitlab.com> | 2023-08-23 16:48:33 +0300 |
---|---|---|
committer | Karthik Nayak <knayak@gitlab.com> | 2023-08-23 16:48:33 +0300 |
commit | 269fac4efa91adeca1ecd297e89b3cdd6678a038 (patch) | |
tree | c278e540dcdbfe220e44569df2df89a036853240 | |
parent | 8e14bf12efa3d6e5340df07eaa5af4e5c891bd91 (diff) |
git: Wire up Git v2.42 execution environment
Wire up the Git v2.42 execution environment so that we can toggle
between the v2.41 and v2.42 release tracks. Major new features that
we're interested in include:
- git-pack-refs(1) learned to take --include and --exclude, which allows
us to skip packing certain references. This is important in the
context of the write-ahead log so that we don't pack write-ahead log
references.
- SHA256 is no longer marked as experimental.
- Git has learned to more efficiently exclude references, which should
help repositories which have many hidden references.
- git-rev-list(1) has learned to take pseudo-refs like --all and --not
in --stdin mode.
- git-cat-file(1) has learned a new -Z switch, which uses NUL delimiters
for both stdin and stdout.
There are naturally various other new features, bugfixes and performance
improvements.
The new Git v2.42 binary is protected by a feature flag.
Changelog: added
-rw-r--r-- | internal/featureflag/ff_git_v242.go | 9 | ||||
-rw-r--r-- | internal/git/execution_environment.go | 7 | ||||
-rw-r--r-- | internal/testhelper/testhelper.go | 2 |
3 files changed, 18 insertions, 0 deletions
diff --git a/internal/featureflag/ff_git_v242.go b/internal/featureflag/ff_git_v242.go new file mode 100644 index 000000000..20615dca0 --- /dev/null +++ b/internal/featureflag/ff_git_v242.go @@ -0,0 +1,9 @@ +package featureflag + +// GitV242 enables the use of Git v2.42. +var GitV242 = NewFeatureFlag( + "git_v242", + "v16.4.0", + "https://gitlab.com/gitlab-org/gitaly/-/issues/5539", + false, +) diff --git a/internal/git/execution_environment.go b/internal/git/execution_environment.go index e613020ff..c4f7608e5 100644 --- a/internal/git/execution_environment.go +++ b/internal/git/execution_environment.go @@ -25,6 +25,13 @@ var ( // case `IsEnabled()` returns `false` though. defaultExecutionEnvironmentConstructors = []ExecutionEnvironmentConstructor{ BundledGitEnvironmentConstructor{ + Suffix: "-v2.42", + FeatureFlags: []featureflag.FeatureFlag{ + featureflag.GitV242, + }, + }, + + BundledGitEnvironmentConstructor{ Suffix: "-v2.41", }, DistributedGitEnvironmentConstructor{}, diff --git a/internal/testhelper/testhelper.go b/internal/testhelper/testhelper.go index 897afe429..b01dc9512 100644 --- a/internal/testhelper/testhelper.go +++ b/internal/testhelper/testhelper.go @@ -238,6 +238,8 @@ func ContextWithoutCancel(opts ...ContextOpt) context.Context { ctx = featureflag.ContextWithFeatureFlag(ctx, featureflag.RunCommandsInCGroup, true) // Randomly enable mailmap ctx = featureflag.ContextWithFeatureFlag(ctx, featureflag.MailmapOptions, rand.Int()%2 == 0) + // Randomly enable either Git v2.41 or 2.42. + ctx = featureflag.ContextWithFeatureFlag(ctx, featureflag.GitV242, rand.Int()%2 == 0) for _, opt := range opts { ctx = opt(ctx) |