You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thanks for your effort in this excellent library.
Recently, I'm mining many OSS repositories using GitPython, it's a handy tool and helps me a lot. And I encountered a weird error when processing this repository.
The minimal code to reproduce the error is:
importgit# git clone https://github.com/zoneminder/zoneminder.git zoneminderrepo=git.Repo("zoneminder")
repo.submodules# <--- This line causes the error
And the exception is:
Traceback (most recent call last):
File "/home/frezcirno/test.py", line 6, in <module>
gitrepo.submodules # <-- this line causes the error
^^^^^^^^^^^^^^^^^^
File "/home/frezcirno/miniconda3/envs/work/lib/python3.11/site-packages/git/repo/base.py", line 422, in submodules
return Submodule.list_items(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frezcirno/miniconda3/envs/work/lib/python3.11/site-packages/git/util.py", line 1189, in list_items
out_list.extend(cls.iter_items(repo, *args, **kwargs))
File "/home/frezcirno/miniconda3/envs/work/lib/python3.11/site-packages/git/objects/submodule/base.py", line 1382, in iter_items
u = parser.get(sms, "url")
^^^^^^^^^^^^^^^^^^^^^^
File "/home/frezcirno/miniconda3/envs/work/lib/python3.11/site-packages/git/config.py", line 122, in assure_data_present
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/frezcirno/miniconda3/envs/work/lib/python3.11/configparser.py", line 808, in get
raise NoOptionError(option, section)
configparser.NoOptionError: No option 'url' in section: 'submodule "web/api/app/Plugin/CakePHP-Enum-Behavior"'
It seems that the root cause is the .gitmodule file in this repository contains a Url instead of url key, which interferes GitPython's parsing process. As a result, commit diff is also unusable.
As the .gitmodule with Url can be correctly recognized by git, would this be a small bug?
The text was updated successfully, but these errors were encountered:
Thanks for reporting. The submodules implementation is definitely not according to specification and it's more a matter of luck if it works. Maybe issues like these that seem to be about capitalization can be fixed though, and I invite contributions.
Hi, thanks for your effort in this excellent library.
Recently, I'm mining many OSS repositories using GitPython, it's a handy tool and helps me a lot. And I encountered a weird error when processing this repository.
The minimal code to reproduce the error is:
And the exception is:
It seems that the root cause is the .gitmodule file in this repository contains a
Url
instead ofurl
key, which interferes GitPython's parsing process. As a result, commit diff is also unusable.As the .gitmodule with
Url
can be correctly recognized by git, would this be a small bug?The text was updated successfully, but these errors were encountered: