-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
OdbBackend: initial groundwork #942
Conversation
"Read raw object data from this odb backend.\n"); | ||
|
||
PyObject * | ||
OdbBackend_read(OdbBackend *self, PyObject *py_hex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note, in keeping with the libgit2 API design, I have no intention of refactoring Odb_read
to go through this code for the sake of DRY.
|
||
/* XXX: This assumes the default libgit2 allocator is in use and will | ||
* probably segfault and/or destroy the universe otherwise */ | ||
free(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💩
looks good |
c24151e
to
ae8c540
Compare
I think the basics are in good shape here. I'm going to implement the rest of the backend interface next and then figure out how to make new backends in Python in a future pull request. |
I've fixed the build errors in AppVeyor, now there're some test failures related to this work. |
I've addressed the feedback and I think that this is mergable, except for the build failure. I looked into it and I don't really understand why it's occuring. By my reckoning, this should affect a lot of tests. Can you take a look and tell me what you think? |
We've seen these errors before. Looking for a little bit I've found commit 00dd78b which fixed 7 errors (6 of them were PermissionErrors): https://ci.appveyor.com/project/techtonik/pygit2/build/1.0.12/tests Commit af983b9 is likely related as well. |
Thanks! |
The rough plan is to make the
OdbBackend
type a fairly straightforward mirror of theodb_backend
in libgit2. I'll then be addingLooseOdbBackend
andPackOdbBackend
, andMempackOdbBackend
, which will inherit fromOdbBackend
and set the underlyingodb_backend
pointer, which should Just Werk based on the approach I have set out so far.The more interesting case is that of user-created
OdbBackend
implementations. I'm not really sure what to do for this yet. The first inch of this work is done in the form of the read call raisingNotImplementedException
if the C implementation is NULL, then through some kind of magic I assume I'll be able to set these to function pointers for some kind of proxy into Python code with some kind of magic base class. Or something. ¯\_(ツ)_/¯