Consider migrating to libgit2/git2go #426
-
Currently the source-controller uses go-git as a dependency to interact with git repositories. go-git is a pure go implementation of the git protocol, which is used by a couple of projects. A long running issue with go-git has been the lack of support for multi_ack and multi_ack_detailed (3 years). As it is a pure go implementation it requires people withing the go community who have know how about the git protocol, something that seems very rare. If maintainer ship of go-git ever becomes an issue I question if there is anyone who can continue supporting the project. libgit2/git2go was considered as an option before the summer but at the time lacked functionality that was required at the time, which it has now received. A major difference, which is good and bad, is that it is a pure c implementation of git core. The good being that the community around the project is a lot larger, as there are bindings to multiple languages. The bad being that it introduces c dependencies to the source-controller, which some may not like. My question is if we could consider moving from go-git to libgit2/git2go in the source-controller. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 10 replies
-
I'm trying to find an active project that uses this library, all I can find are some abandoned experiments on GitHub. Maybe no one uses it due to thread safety concerns: "This may also make SSH connections thread-safe if your copy of libssh2 is linked against OpenSSL." |
Beta Was this translation helpful? Give feedback.
-
I propose we create an interface for our git package and add the git2go implementation. Then in the |
Beta Was this translation helpful? Give feedback.
-
There is now a PR that would solve this discussion. |
Beta Was this translation helpful? Give feedback.
I propose we create an interface for our git package and add the git2go implementation. Then in the
GitRepository
spec users will be able to switch between the two using a field namedgitProtocal
that acceptsv1
(go-git) andv2
(git2go), when not specified defaults tov1
. We need to document the differences and tell Azure DevOps users to usev2
. We should warn users that using git2go means that source-controller will fetch all the git history, for some repos this means downloading GB of data that could fill the disk and also impact their traffic costs by a lot.