Skip to content

Submodule.open() fix, URL write support #513

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

Closed
wants to merge 3 commits into from
Closed

Submodule.open() fix, URL write support #513

wants to merge 3 commits into from

Conversation

pks-t
Copy link
Member

@pks-t pks-t commented Apr 13, 2015

Well. As has been initially proposed by @jdavid this PR rewrites the submodule feature I've been implementing in Python with CFFI. Reason has been a problem that I overlooked with the previous implementation, where the repository returned by submodule.open() was not a pygit2.Submodule but of the C SubmoduleType, thus missing some properties/methods. As I found no easy way to properly instantiate the pygit2.Submodule type instead of the C type from C code I just reimplemented that in Python. If there is any obvious way of doing it I may as well do that, if requested.

Some additional functions have been implemented, as well, thus providing URL write support for submodules, their repos and gitmodule entries.

pks-t added 3 commits April 13, 2015 12:26
The submodule type has been implemented as a C type. When opening
a submodule's repository this leads to the bug that instead of an
actual pygit2.Repository being instantiated we only create an
object of the C Repository type.

As this is not trivially fixed within the C code, reimplement the
submodule type as a Python interface with CFFI. As submodules
provide no functionality that is usually accessed repeatedly the
code paths should not prove performance critical. In addition,
maintainability is improved by this reimplementation.
@jdavid
Copy link
Member

jdavid commented Apr 13, 2015

Hello,

I could reproduce the errors reported by travis locally.

Then tested just the first patch, tests pass for Python 2.7 but don't for Python 3

@pks-t
Copy link
Member Author

pks-t commented Apr 13, 2015

That at least explains why they fail for the Py3 configs. I'll try to fix them later, probably this evening.

@pks-t
Copy link
Member Author

pks-t commented Apr 16, 2015

Ah, I get what's happening here. The build is tripping over an error in libgit2 which I've already been fixing upstream. As we're not using the newest build the error is obviously still happening. I'll split up the pull request, as the type-fix is applicable without my libgit2 fixes.

@pks-t pks-t closed this Apr 16, 2015
@pks-t pks-t deleted the submodule_additions branch April 16, 2015 09:14
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.

2 participants