@classmethod
    def list_from_string(cls, repo, text):
        lines = [l for l in text.strip().splitlines()]

        commits = []

        while lines:
            id = lines.pop(0).split()[1]
            tree = lines.pop(0).split()[1]

            parents = []
            while lines and lines[0].startswith('parent'):
                parents.append(lines.pop(0).split()[-1])
            author, authored_date = cls.actor(lines.pop(0))
            committer, committed_date = cls.actor(lines.pop(0))

            messages = []
            lines.pop(0)
            while lines and lines[0].startswith('    '):
                messages.append(lines.pop(0).strip())

            message = '\n'.join(messages)

            commits.append(GitUpstreamCompatCommit(
                repo, id=id, parents=parents,
                tree=tree, author=author,
                authored_date=authored_date,
                committer=committer,
                committed_date=committed_date,
                message=message))

            while lines:
                if not lines[0].strip():
                    lines.pop(0)
                else:
                    break
        return commits
Parse out commit information into a list of Commit objects
dataset/ETHPy150Open openstack/git-upstream/git_upstream/lib/pygitcompat.py/GitUpstreamCompatCommit.list_from_string