-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Submodule commit causes an error #260
Comments
Same error when calling pydriller.Commit.modified_files |
Hi! The commit you are referring to is in a submodule. As a test, try to run:
in your terminal. You'll see Git returns an error. After you init the submodules that should go away. |
I understand that. The issue is that they removed the submodules, so the .gitmodules is empty and init does nothing. I tried to work around it by retrieving the history of .gitmodules with And when I call CodeChurn or a DMM metric, it still fails because Pydriller stays in the root folder. |
@ishepard Here is the test script I put together if you want to try it out yourself. I'm running Python 3.8 and Pydriller 2.4.1
|
Describe the bug
I'm analyzing the github repo avatarify and the commits containing submodule commits such as this one causes an exception to be raised:
ValueError: SHA b'72a32a67dee3a67dff76f565551907a2fc7e88e6' could not be resolved, git returned: b'72a32a67dee3a67dff76f565551907a2fc7e88e6missing'
The hash in the error being the one of the submodule commit.
To Reproduce
I've noticed this issue on 2 occurrences while working with avatarify:
When I use
commits = pydriller.Repository(...).traverse_commits()
and retrieve either of dmm_unit_size/dmm_unit_complexity/dmm_unit_interfacing:
This is straightforward to patch on my side as I can just try-catch these metrics and replacing them by None if it fails on a commit. However the second case would require a change out of my reach.
When I call the constructor of
pydriller.metrics.process.code_churn.CodeChurn
Unless I avoid the problematic commits by navigating with CodeChurn's from_commit/to_commit around them, I simply cannot compute the repo's churn
OS Version:
Windows
The text was updated successfully, but these errors were encountered: