Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to libgit2 v0.22 #459

Merged
merged 4 commits into from
Jan 16, 2015
Merged

Update to libgit2 v0.22 #459

merged 4 commits into from
Jan 16, 2015

Conversation

carlosmn
Copy link
Member

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 ssl module 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.

@aspiers
Copy link

aspiers commented Jan 6, 2015

It would be awesome if the next release of pygit2 could support the new describe stuff introduced by libgit2/libgit2#2592 ;-)

@carlosmn
Copy link
Member Author

carlosmn commented Jan 7, 2015

Sure, but that's rather outside of the scope of this PR.

@aspiers
Copy link

aspiers commented Jan 7, 2015

@carlosmn Oh OK sorry, I guess I misunderstood something. Why is it outside this PR's scope?

@carlosmn
Copy link
Member Author

carlosmn commented Jan 7, 2015

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.

@carlosmn carlosmn changed the title [WIP] Update to libgit2 v0.22 Update to libgit2 v0.22 Jan 12, 2015
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.
@jdavid
Copy link
Member

jdavid commented Jan 14, 2015

Hi @carlosmn

Now that libgit2 v0.22 has been released, do you think this PR is ready to be merged?

@carlosmn
Copy link
Member Author

Yeah, everything that changed should be working with the new version.

@jdavid jdavid merged commit 78695aa into libgit2:master Jan 16, 2015
@carlosmn carlosmn deleted the development branch January 16, 2015 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants