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

Store submodule name #679

Merged
merged 1 commit into from Oct 2, 2017
Merged

Conversation

@jakirkham
Copy link
Contributor

@jakirkham jakirkham commented Oct 2, 2017

Fixes #678

Seems there are a plethora of things that expect to be able to get a submodule's name. However it is not defined if Submodule.add finds the submodule already exists. This is one attempt at trying to solve this issue.

@Byron
Copy link
Member

@Byron Byron commented Oct 2, 2017

Thanks for your contribution! At this time I unfortunately also don’t know if there are better ways to fix this, but believe it’s OK to assume it’s not making anything worse if the tests are not breaking.
Ideally there would also be a test that requires the code-change in order to be passing, but I understand the test-suite is messy and impossible to understand, so I wouldn’t ask for it :)!

@Byron Byron merged commit 95ff827 into gitpython-developers:master Oct 2, 2017
1 of 2 checks passed
1 of 2 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@jakirkham jakirkham deleted the jakirkham:fix_create_submodule branch Oct 2, 2017
@jakirkham
Copy link
Contributor Author

@jakirkham jakirkham commented Oct 2, 2017

At this time I unfortunately also don’t know if there are better ways to fix this, but believe it’s OK to assume it’s not making anything worse if the tests are not breaking.

After trying a few things locally, this seemed to allow the submodule to behave normally. Though would think the name should be coming from .gitmodules. Just wasn't clear to me why that wasn't happening or how to fix it.

Ideally there would also be a test that requires the code-change in order to be passing, but I understand the test-suite is messy and impossible to understand, so I wouldn’t ask for it :)!

Sorry. Should have included a test. TBH wasn't sure if this seemingly hacky fix would be accepted or so quickly. 😄 Thanks for that. I'll give the test some thought.

jakirkham added a commit to jakirkham/conda-forge-webservices that referenced this pull request Oct 2, 2017
Uses a workaround already accepted upstream to fix `create_submodule`
when the submodule already exists. In particular naming the submodule
with the user provided name. By being able to use `create_submodule`,
this script runs substantially faster than when calling `submodule`.
Reason being calling `submodule` lists all submodules in the repo and
then selects the one we named. Whereas `create_submodule` simply
provides us the requested submodule. So using this workaround is
necessary for the performance improvement it provides.

ref: gitpython-developers/GitPython#679
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.