Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

How to display the progress of the download (clone_from) ? #1059

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

Open
qcha41 opened this issue Sep 24, 2020 · 1 comment
Open

How to display the progress of the download (clone_from) ? #1059

qcha41 opened this issue Sep 24, 2020 · 1 comment
Labels

Comments

@qcha41
Copy link

qcha41 commented Sep 24, 2020

Hello,

I am a new GitPython user and I would like to display a progress bar when cloning locally a large GitHub repository. To begin with, I have created a RemoteProgress based class and I have plugged it in the clone_from() function :

from git import Repo
from git.remote import RemoteProgress

class Progress(RemoteProgress):
    def update(self, *args):
        print(self._cur_line)

Repo.clone_from(github_url,local_path,progress=Progress())

When I run it, I have well the progress from 0 to 100% of remote: Counting objects: and remote: Compressing objects: steps (which are super fast) but after that, nothing more : the terminal keep freezed until the end of the download.

How to catch the progress of the download itself ?

Thank you in advance!

@Byron
Copy link
Member

Byron commented Sep 28, 2020

From what I could gather in the docs this is essentially what needs to be done, and that should include local progress (indexing, resolving) along with remote progress.

Maybe for some reason progress cannot be parsed, maybe override line_dropped(self, line) to learn about lines that couldn't be parsed.

Nonetheless, I would also expect that to work in a more straightforward fashion, maybe we can figure that out here.

@Byron Byron added the Q&A label Sep 28, 2020
@Byron Byron closed this as completed Feb 26, 2021
@gitpython-developers gitpython-developers locked and limited conversation to collaborators Feb 26, 2021
@Byron Byron reopened this Feb 26, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Development

No branches or pull requests

2 participants