@@ -51,9 +51,12 @@ type GitRepositorySpec struct {
5151 // +optional
5252 Suspend bool ` json:"suspend,omitempty"`
5353
54- // Enables support for git servers that require v2.
54+ // Determines which git client library to use.
55+ // Defaults to go-git, valid values are ('go-git', 'git2go').
56+ // +kubebuilder:validation:Enum=go-git;git2go
57+ // +kubebuilder:default:=go-git
5558 // +optional
56- GitProtocolV2Compatibility bool ` json:"gitProtocolV2Compatibility "`
59+ GitImplementation string ` json:"gitImplementation,omitempty "`
5760}
5861```
5962
@@ -174,12 +177,13 @@ spec:
174177
175178When specified, ` spec.ignore` overrides the default exclusion list.
176179
177- # # Git V2
180+ # # Git Implementation
178181
179- You should skip this unless you know that you need v2 compatibility. Enabling
180- this feature comes with its own set of drawbacks.
182+ You can skip this section unless you know that you need support for either
183+ specific git wire protocol functionality. Changing the git implementation
184+ comes with its own set of drawbacks.
181185
182- Some git providers like Azure DevOps require special features in the users git client
186+ Some git providers like Azure DevOps require that the git client supports specific capabilities
183187to be able to communicate. The initial library used in source-controller did not support
184188this functionality while other libraries that did were missinging other critical functionality,
185189specifically the ability to do shallow cloning. Shallow cloning is important as it allows
@@ -188,12 +192,12 @@ For some very large repositories this means downloading GB of data that could fi
188192and also impact the traffic costs.
189193
190194To be able to support Azure DevOps a compromise solution was built, giving the user the
191- option to enable V2 compatibility with the drawbacks it brings .
195+ option to select the git library while accepting the drawbacks .
192196
193- | V2 Compatibility | Shallow Clones | Azure DevOps Support |
197+ | Git Implementation | Shallow Clones | Azure DevOps Support |
194198|---|---|---|
195- | false | true | false |
196- | true | false | true |
199+ | 'go-git' | true | false |
200+ | 'git2go' | false | true |
197201
198202Pull the master branch from a repository in Azure DevOps.
199203
@@ -206,7 +210,7 @@ metadata:
206210spec:
207211 interval: 1m
208212 url: https://dev.azure.com/org/proj/_git/repo
209- gitProtocolV2Compatibility: true
213+ gitImplementation: git2go
210214` ` `
211215
212216# # Spec examples
0 commit comments