Skip to content

Script hangs in some repos #20

@Falenos

Description

@Falenos

I already managed to run the script for some repos, but in hangs on others.
Debugged a bit and checked out till the first version, but the same thing happens.
Something else I noticed is that these repos had the .git/branches dir empty, not sure if it's relevant.
I can see this, when i stop the script manually
Starting ^CTraceback (most recent call last): File "run_script.py", line 15, in <module> importer.import_repository() File "/Users/ydrargyros/Projects/Contributions-Importer-For-Github/git_contributions_importer/Importer.py", line 74, in import_repository for c in self.get_all_commits(last_committed_date): File "/Users/ydrargyros/Projects/Contributions-Importer-For-Github/git_contributions_importer/Importer.py", line 133, in get_all_commits if c.committed_date < ignore_before_date or (self.ignore_before_date != None and c.committed_date < self.ignore_before_date): File "/usr/local/lib/python3.8/site-packages/gitdb/util.py", line 253, in __getattr__ self._set_cache_(attr) File "/usr/local/lib/python3.8/site-packages/git/objects/commit.py", line 143, in _set_cache_ self._deserialize(BytesIO(stream.read())) File "/usr/local/lib/python3.8/site-packages/git/cmd.py", line 446, in read data = self._stream.read(size) KeyboardInterrupt

When i removed the /branches
Starting ^CTraceback (most recent call last): File "run_script.py", line 15, in <module> importer.import_repository() File "/Users/ydrargyros/Projects/Contributions-Importer-For-Github/git_contributions_importer/Importer.py", line 74, in import_repository for c in self.get_all_commits(last_committed_date): File "/Users/ydrargyros/Projects/Contributions-Importer-For-Github/git_contributions_importer/Importer.py", line 133, in get_all_commits if c.committed_date < ignore_before_date or (self.ignore_before_date != None and c.committed_date < self.ignore_before_date): File "/usr/local/lib/python3.8/site-packages/gitdb/util.py", line 253, in __getattr__ self._set_cache_(attr) File "/usr/local/lib/python3.8/site-packages/git/objects/commit.py", line 142, in _set_cache_ _binsha, _typename, self.size, stream = self.repo.odb.stream(self.binsha) File "/usr/local/lib/python3.8/site-packages/git/db.py", line 42, in stream hexsha, typename, size, stream = self._git.stream_object_data(bin_to_hex(sha)) File "/usr/local/lib/python3.8/site-packages/git/cmd.py", line 1085, in stream_object_data hexsha, typename, size = self.__get_object_header(cmd, ref) File "/usr/local/lib/python3.8/site-packages/git/cmd.py", line 1057, in __get_object_header return self._parse_object_header(cmd.stdout.readline()) KeyboardInterrupt
Thanks for this nice tool

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions