Skip to content

Issue cloning large repositories #301

Description

@jantman

GitPython seems to break on large repositories. I've hacked a bit of additional output into the assertion at https://github.com/gitpython-developers/GitPython/blob/master/git/remote.py#L576 :

        # NOTE: We assume to fetch at least enough progress lines to allow matching each fetch head line with it.
        assert len(fetch_info_lines) >= len(fetch_head_info), "%d <= %d - len(fetch_head_info) <= len(fetch_info_lines) : len(%s) <= len(%s)" % (
            len(fetch_head_info),
            len(fetch_info_lines),
            fetch_head_info,
            fetch_info_lines)

When I run git.Repo.clone_from() or .fetch(), it produces:

[DEBUG reconcile_git_repos.py:95 -       clone_or_fetch() ] Fetching origin in /localfs/users/jantman/B-07815/storyville2.git
Traceback (most recent call last):
  File "./reconcile_git_repos.py", line 168, in <module>
    args = parse_args(sys.argv[1:])
  File "./reconcile_git_repos.py", line 75, in run
    self.clone_or_fetch(path, url, fetch=fetch)
  File "./reconcile_git_repos.py", line 96, in clone_or_fetch
    except git.exc.NoSuchPathError:
  File "/home/jantman/tickets/B-07815/lib/python2.7/site-packages/git/remote.py", line 654, in fetch
    res = self._get_fetch_info_from_stderr(proc, progress or RemoteProgress())
  File "/home/jantman/tickets/B-07815/lib/python2.7/site-packages/git/remote.py", line 588, in _get_fetch_info_from_stderr
    fetch_info_lines)
AssertionError: 1944 <= 1716 : len([u"c415f018

... and then an amazingly long line of output.

This appears to happen with very large repositories; I honestly can't tell if the issue here is commit messages or the repository size - the one I used for testing has (yeah..... :( ) 4,789 branches.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions