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 call fetch(), push(), pull() with the parameter progress=<anything>, the programm is stuck and the update method does not get called. If I call those operations without setting the progress parameter, it works flawlessly.
$ git --version is 2.21.0
- Calling
sys.stdout.flush() after print() does not help either
- I use
assert to assure my repo objects are available and in the expected state
ProgressPrinter() yields not None
- I tried calling the functions from the main thread and multithreaded
- I took a look at the implementation (line 350) of
RemoteProgress and also the implementation (line 815) of push() and do not see a reason, why it would not continue execution
- I found out, that when I assign my
ProgressPrinter instance and pass the assigned variable, the programm is not stuck anymore. Yet the update() method does not get called and no progress is printed:
# Not stuck anymore, yet no progress
pp = ProgressPrinter()
fetch_info = origin.fetch(progress=pp)
Core of my implementation:
from git import RemoteProgress
class ProgressPrinter(RemoteProgress):
def update(self,
op_code,
cur_count,
max_count=None,
message=''):
print("Is this even called?")
And later on:
origin = repo.remotes.origin
assert origin.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.
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 call
fetch(),push(),pull()with the parameterprogress=<anything>, the programm is stuck and theupdatemethod does not get called. If I call those operations without setting theprogressparameter, it works flawlessly.$ git --versionis 2.21.0sys.stdout.flush()afterprint()does not help eitherassertto assure my repo objects are available and in the expected stateProgressPrinter()yields notNoneRemoteProgressand also the implementation (line 815) ofpush()and do not see a reason, why it would not continue executionProgressPrinterinstance and pass the assigned variable, the programm is not stuck anymore. Yet theupdate()method does not get called and no progress is printed:Core of my implementation:
And later on:
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.