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

Add Submodule type. #499

Merged
merged 5 commits into from
Mar 9, 2015
Merged

Add Submodule type. #499

merged 5 commits into from
Mar 9, 2015

Conversation

pks-t
Copy link
Member

@pks-t pks-t commented Mar 4, 2015

Add the submodule type with methods Repository.lookup_submodule(path)->Submodule, Repository.listall_submodules()->[paths], Submodule.open()->Repository and attributes Submodule.path, Submodule.url, Submodule.name.

@pks-t
Copy link
Member Author

pks-t commented Mar 4, 2015

If the pull request is considered for merge I can provide tests for this. First I'd like some comments though as I'm unexperienced with Python's cffi.

@jdavid
Copy link
Member

jdavid commented Mar 6, 2015

Hello,

This is a feature that could be done from cffi without performance problems. Having a Repository.submodules like we have a Repository.remotes may be a friendlier API, what do you think @carlosmn ?

Anyway, the proposed API is fine too. If you add the unit tests, and after a couple of coding review iterations, this will be in a mergeable state.

Basically I leave it up to you whether you want to explore the possibility of Respository.submodules, or just go ahead with this API (pending comments from @carlosmn )

@pks-t
Copy link
Member Author

pks-t commented Mar 6, 2015

Thanks for your comments. Repository.submodules would certainly be a nice way to access submodules. It shouldn't be that much code that's changing, though, so I'll first work on the issues you've highlighted and wait for comments from @carlosmn regarding API changes.

@pks-t
Copy link
Member Author

pks-t commented Mar 6, 2015

I've fixed the issues you've highlighted and added some basic tests for the preliminary API.

@jdavid jdavid merged commit 9a4e002 into libgit2:master Mar 9, 2015
@pks-t pks-t deleted the submodules branch March 17, 2015 09:53
@Thrimbda
Copy link

may I ask how to add a submodule using pygit2?
I tried clone a repo which I want to use as a submodule into my repo but it just added a directory not a git submodule.
so... how to add a submodule exactly?

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.

None yet

3 participants