Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix submodules listing error#818

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@stsewd
Copy link
Contributor

Fix#279

When the path doesn't exist, gitpython throws an error, this usually happens when the user deletes the submodule directory but not the submodule entry in.gitmodules.

@Byron
Copy link
Member

Thanks a lot for the contribution and the test. I will be happy to merge after some clarification.

Could you have a look at the test that actually wants the ‘InvavalidGitRepository’ exception? It causes travis to fail consistently. Maybe that usecase is now obsolete by the new behaviour, which is when the test can be adjusted to claim that ‘nothing should happen’ if the submodule is invalid.

Maybe that test, however, could also show that the ‘InvalidGitRepository’ error should rather be cought in the spot that interests you in particular, for example, when listing submodules, instead of removing it entirely.

@stsewd
Copy link
ContributorAuthor

Sorry I didn't comment yesterday, I was trying to solve that failing test but some tests are not passing locally (master), need to figure out that first.

@stsewd
Copy link
ContributorAuthor

Maybe that test, however, could also show that the ‘InvalidGitRepository’ error should rather be cought in the spot that interests you in particular, for example, when listing submodules, instead of removing it entirely.

I'm not following, sorry. Do you mean to keep the exception and passing the failed submodule as an attribute?

Copy link
Member

@ByronByron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I left a few comments were they matter, maybe this helps to understand what I mean. If anything remains unclear, please let me know.

entry=index.entries[index.entry_key(p,0)]
sm=Submodule(repo,entry.binsha,entry.mode,entry.path)
exceptKeyError:
raiseInvalidGitRepositoryError(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Is there a way for this Exception to stay, just as there is a test that expects this behaviour (see the test-failure on travis).

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If we do that, we wouldn't be able to keep listing the submodules here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@stsewd I think all that's left before the merge is to fix the now failing test. It could be changed to now expect to no failure and to see a listing of the existing submodules - if you think there is not too much overlap with the test you added.

stsewd reacted with thumbs up emoji
@stsewd
Copy link
ContributorAuthor

Also, reading the test looks like the code is doing what we want to avoid

# update fails as list_items in such a situations cannot work, as it cannot
# find the entry at the changed path
self.failUnlessRaises(InvalidGitRepositoryError,rm.update,recursive=False)
# move it properly - doesn't work as it its path currently points to an indexentry
# which doesn't exist ( move it to some path, it doesn't matter here )
self.failUnlessRaises(InvalidGitRepositoryError,sm.move,pp)
# reset the path(cache) to where it was, now it works

The tests are expecting to raise an exception if it can't find the correct path of the submodule, while git just list the valid ones.

@codecov-io
Copy link

codecov-io commentedFeb 2, 2019
edited
Loading

Codecov Report

Merging#818 intomaster willincrease coverage by<.01%.
The diff coverage is100%.

Impacted file tree graph

@@            Coverage Diff             @@##           master     #818      +/-   ##==========================================+ Coverage   94.67%   94.68%   +<.01%==========================================  Files          59       59                Lines        9393     9399       +6     ==========================================+ Hits         8893     8899       +6  Misses        500      500
Impacted FilesCoverage Δ
git/objects/submodule/base.py94.35% <100%> (ø)⬆️
git/test/test_submodule.py99.25% <100%> (+0.01%)⬆️
git/cmd.py83.83% <0%> (-0.14%)⬇️
git/test/test_remote.py97.8% <0%> (-0.02%)⬇️
git/repo/base.py95.24% <0%> (ø)⬆️

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update6971a93...6a235bc. Read thecomment docs.

@stsewd
Copy link
ContributorAuthor

I just updated the test, sorry for the long wait. Now py37 is failing, but doesn't look related to this change.

@stsewdstsewdforce-pushed thefix-submodules-listing branch from31d99b5 to6a235bcCompareJune 25, 2019 15:10
@stsewd
Copy link
ContributorAuthor

stsewd commentedJun 25, 2019
edited
Loading

@Byron tests are passing now, any change to get this merged? Thank you! Appveyor is failing in master (isn't triggering for this PR I think), though

stsewd added a commit to stsewd/readthedocs.org that referenced this pull requestJul 10, 2019
Currently we show a generic message.Related:readthedocs#4371This can be removed whengitpython-developers/GitPython#818gets merged.
@ByronByron merged commite93ffe1 intogitpython-developers:masterJul 20, 2019
@Byron
Copy link
Member

Sorry for the wait, and thanks a lot for the fixes!

stsewd reacted with hooray emoji

@stsewdstsewd deleted the fix-submodules-listing branchJuly 20, 2019 16:33
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ByronByronByron approved these changes

Assignees

No one assigned

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Error while listing submodules

3 participants

@stsewd@Byron@codecov-io

[8]ページ先頭

©2009-2026 Movatter.jp