GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — How to display the progress of the download (clone_from) ? · gitpython-developers/GitPython · Discussion #1134

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

Answered by Byron
qcha41 asked this question in Q&A
How to display the progress of the download (clone_from) ? #1134
@qcha41 qcha41
Sep 24, 2020 · 2 comments
Answered by Byron Return to top
Discussion options
  • Uh oh!

    There was an error while loading. Please reload this page.

qcha41
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!

You must be logged in to vote
All reactions
Answered by Byron 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.

View full answer

Replies: 2 comments

Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

Byron
Sep 28, 2020
Maintainer

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.

You must be logged in to vote
All reactions
0 replies
Answer selected by Byron
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

emcek
Dec 1, 2023

Looks like similar problem... https://stackoverflow.com/questions/51045540/python-progress-bar-for-git-clone

You must be logged in to vote
All reactions
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
3 participants
@qcha41 @Byron @emcek
Converted from issue

This discussion was converted from issue #1059 on February 26, 2021 11:13.

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.