-
-
Notifications
You must be signed in to change notification settings - Fork 906
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
Error while listing submodules #279
Comments
Thanks for letting me know. Would you post code or any other means to help me reproducing this issue? This will make a fix so much easier. |
GitPython v1.0.0 To reproduce it, just add a submodule, commit, then remove it, remove git directory is '.git/modules', too. keep the entry is '.gitmdoules'. commit again. when the repository is a normal repository, 'repo.submodules' fail, 'repo.iter_submodules()' still works. from git import Repo repo = Repo('path') just some code like this will do the trick |
Thank you ! The statements above are just my preliminary opinion, I don't know the code underneath good enough to know if this behaviour is good or not. Can you also state which behaviour you would expect ? |
'.gitmodules' may contains entries of already removed submodules, when someone clone it, these repository are naturally not exist in '.git/modules'. this when the problem occurs. I encounter this problem on this repository https://github.com/lungothrin/android.git, It tremendous big. |
Thanks for the clarification. GitPython currently entirely ignores the information in |
clone this project you will get what you need to reproduce the problem. It is about 350MiB |
Hi! We are experimenting this issue in Read the Docs for some particular repositories (readthedocs/readthedocs.org#4371 (comment)). I'd like to know if you plan to add this issue into your roadmap or not and when it could be fixed? The proposed workaround using The repo linked in the Read the Docs issue is one that can be used to reproduce this problem. Example:
Thanks! |
@humitos Thanks for posting here and adding additional weight! As we are in maintenance mode, all contributions are donated, but highly appreciated. Depending on the impact of the fix or feature, new releases are cut without delay. That said, would you find yourself capable of providing a fix? |
GitPython has a problem while listing submodules.
As '.gitmodules' contains all the modules have ever been registered, it becomes problematic when some of them are removed. 'repo.submodules' will fail to work in this situation, though, 'repo.iter_submodules()' still works. But when 'repo' itself is a submodule, 'repo.iter_submodules()' does not yield any result.
The text was updated successfully, but these errors were encountered: