-
Notifications
You must be signed in to change notification settings - Fork 1
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: SHA could not be resolved #35
Comments
Fixed the first issue in #36 |
Same error is raised when calculating the versions' churn. |
Same error is raised when calling pydriller.Commit.modified_files |
While waiting for a fix from PyDriller, BugPrediction will just skip the problematic commits/versions and leave a warning log. This issue with submodules will also be added in the readme's limitations |
* Fixed issue in git connector The issue is caused by a submodule commit that cannot be accessed by pydriller to compute the DMM metrics. If the error occurs, we just skip the metrics for this particular commit * Skipping problematic commits/versions * Added submodule limitation to readme
When using the populate command on the Python project https://github.com/alievk/avatarify-python we get this error:
Traceback (most recent call last):
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\main.py", line 403, in
cli(obj={})
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\click\core.py", line 764, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\click\decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "src/dependency_injector/_cwiring.pyx", line 28, in dependency_injector._cwiring._get_sync_patched._patched
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\main.py", line 296, in populate
git.populate_db(skip_versions)
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\connectors\git.py", line 135, in populate_db
self.create_commits_from_repo()
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\utils\timeit.py", line 9, in timeit_wrapper
result = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\connectors\git.py", line 95, in create_commits_from_repo
dmm_unit_size=git_commit.dmm_unit_size,
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\pydriller\domain\commit.py", line 797, in dmm_unit_size
return self._delta_maintainability(DMMProperty.UNIT_SIZE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\pydriller\domain\commit.py", line 845, in _delta_maintainability
delta_profile = self._delta_risk_profile(dmm_prop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\pydriller\domain\commit.py", line 863, in _delta_risk_profile
mod for mod in self.modified_files if mod.language_supported
^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\pydriller\domain\commit.py", line 716, in modified_files
return self._parse_diff(diff_index)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\pydriller\domain\commit.py", line 728, in _parse_diff
"content": self._get_undecoded_content(diff.b_blob),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\pydriller\domain\commit.py", line 752, in _get_undecoded_content
return blob.data_stream.read() if blob is not None else None
^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\git\objects\base.py", line 142, in data_stream
return self.repo.odb.stream(self.binsha)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\git\db.py", line 45, in stream
hexsha, typename, size, stream = self._git.stream_object_data(bin_to_hex(binsha))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\git\cmd.py", line 1400, in stream_object_data
hexsha, typename, size = self.__get_object_header(cmd, ref)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\git\cmd.py", line 1370, in __get_object_header
return self._parse_object_header(cmd.stdout.readline())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\antoine.micard\Desktop\bugprediction repos\bugprediction\venv\Lib\site-packages\git\cmd.py", line 1331, in _parse_object_header
raise ValueError("SHA %s could not be resolved, git returned: %r" % (tokens[0], header_line.strip()))
ValueError: SHA b'72a32a67dee3a67dff76f565551907a2fc7e88e6' could not be resolved, git returned: b'72a32a67dee3a67dff76f565551907a2fc7e88e6 missing'
The text was updated successfully, but these errors were encountered: