Merged
Conversation
0106737 to
ea9b3d8
Compare
|
It would be awesome if the next release of pygit2 could support the new |
Member
Author
|
Sure, but that's rather outside of the scope of this PR. |
|
@carlosmn Oh OK sorry, I guess I misunderstood something. Why is it outside this PR's scope? |
Member
Author
|
This PR is to update pygit2. You're asking to add new features. It's already a large enough without having to worry about what's new. |
Apart from the usual API changes, we now need to introduce the concept of whether we still own the C object underneath our Repository and Remote objects. When using the custom callbacks for repository and remote creation during clone, we pass the pointer and thus ownership of the object back to the library. We will then get the repository back at the end. We return the object which was handed to us rather than opening the repository again with the local path as there is now a much higher chance that the cloned repository does not use the standard backends.
Move to use git_remote_push() instead of doing the steps ourselves. We also change to accept a list of refspecs instead of just the one refspec for the push method. As part of this, we no longer error out if the server rejected any updates, as this is a different concern from whether the push itself failed or not. We do still error out if we attempt to push non-ff updates.
We do not pass anything as the certificate, as there doesn't seem to be anything sensible for checking it.
Member
|
Hi @carlosmn Now that libgit2 v0.22 has been released, do you think this PR is ready to be merged? |
Member
Author
|
Yeah, everything that changed should be working with the new version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The new release should be coming out soon, so let's get ready to update. This new version allows much more customisation of how remotes and repositories are created on clone, which introduced a new concept for us, namely passing ownership of remotes and repositories to the library, which is why there's
_Repository._from_c()and_Repository._disown().At the moment there is on feature replacement missing: we no longer expose a boolean to ignore errors but put the handling of certificates in the hands of the programmer. This is done via passing the DER-encoded certificate, to work around the different TLS implementations.
Unfortunately, the parsing done by python's
sslmodule is deep in C code and expects us to have set up a connection via OpenSSL wrapping some socket. But all we can assume is that we're have a buffer with the certificate. If anybody knows of some python module to parse such a buffer, I'd love to know. Everything I've been able to find is either going down to the ASN.1 level or rather incomplete.