Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reading progress of Git operation using GitPython stuck (or not printing) #871

Closed
@t89

Description

@t89

I'm trying to access the progress of time consuming Git operations using GitPython. I tried the sample solution taken from the official documentation, and also tried passing in a method following the exact signature of the update method below. Everytime I callfetch(),push(),pull()with the parameterprogress=<anything>, the programm is stuck and theupdate method does not get called. If I call those operations without setting theprogress parameter, it works flawlessly.

  • $ git --version is 2.21.0
  • Callingsys.stdout.flush() afterprint() does not help either
  • I useassert to assure my repo objects are available and in the expected state
  • ProgressPrinter() yields notNone
  • I tried calling the functions from the main thread and multithreaded
  • I took a look at theimplementation (line 350) ofRemoteProgress and also theimplementation (line 815) ofpush() and do not see a reason, why it would not continue execution
  • I found out, that when I assign myProgressPrinter instance and pass the assigned variable, the programm is not stuck anymore. Yet theupdate() method does not get called and no progress is printed:
# Not stuck anymore, yet no progresspp=ProgressPrinter()fetch_info=origin.fetch(progress=pp)

Core of my implementation:

fromgitimportRemoteProgressclassProgressPrinter(RemoteProgress):defupdate(self,op_code,cur_count,max_count=None,message=''):print("Is this even called?")

And later on:

origin=repo.remotes.originassertorigin.exists()fetch_info=origin.fetch(progress=ProgressPrinter())

Any recommendations on how to investigate this problem furthermore? I've been debugging this for several days now and feel like I am missing something.

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp