Title: Reading progress of Git operation using GitPython stuck (or not printing) · Issue #871 · gitpython-developers/GitPython · GitHub
Open Graph Title: Reading progress of Git operation using GitPython stuck (or not printing) · Issue #871 · gitpython-developers/GitPython
X Title: Reading progress of Git operation using GitPython stuck (or not printing) · Issue #871 · gitpython-developers/GitPython
Description: 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 ...
Open Graph Description: 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 t...
X Description: 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 followi...
Opengraph URL: https://github.com/gitpython-developers/GitPython/issues/871
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Reading progress of Git operation using GitPython stuck (or not printing)","articleBody":"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=\u003canything\u003e`, 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.\r\n\r\n- `$ git --version` is 2.21.0\r\n- Calling `sys.stdout.flush()` after `print()` does not help either\r\n- I use `assert` to assure my repo objects are available and in the expected state\r\n- `ProgressPrinter()` yields not `None`\r\n- I tried calling the functions from the main thread and multithreaded\r\n- I took a look at the [implementation (line 350)][1] of `RemoteProgress` and also the [implementation (line 815)][2] of `push()` and do not see a reason, why it would not continue execution\r\n- 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:\r\n\r\n```python\r\n# Not stuck anymore, yet no progress\r\npp = ProgressPrinter()\r\nfetch_info = origin.fetch(progress=pp)\r\n```\r\n___\r\nCore of my implementation:\r\n\r\n```python\r\nfrom git import RemoteProgress\r\n\r\nclass ProgressPrinter(RemoteProgress):\r\n def update(self,\r\n op_code,\r\n cur_count,\r\n max_count=None,\r\n message=''):\r\n print(\"Is this even called?\")\r\n```\r\nAnd later on:\r\n```python\r\norigin = repo.remotes.origin\r\nassert origin.exists()\r\nfetch_info = origin.fetch(progress=ProgressPrinter())\r\n\r\n```\r\n\r\nAny recommendations on how to investigate this problem furthermore? I've been debugging this for several days now and feel like I am missing something. \r\n\r\n [1]: https://github.com/gitpython-developers/GitPython/blob/52ee33ac9b234c7501d97b4c2bf2e2035c5ec1fa/git/util.py#L350\r\n [2]: https://github.com/gitpython-developers/GitPython/blob/52ee33ac9b234c7501d97b4c2bf2e2035c5ec1fa/git/remote.py#L815","author":{"url":"https://github.com/t89","@type":"Person","name":"t89"},"datePublished":"2019-05-06T12:50:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/871/GitPython/issues/871"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a1fb92c5-b930-08dc-69eb-ad2b1ea7819d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 882C:169ED8:13DE39F:1AA3DDC:6969AEEE |
| html-safe-nonce | e33fe04e744c13296a71df2d18586acac31e97fe3e61ed85933ee3900be0be65 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODJDOjE2OUVEODoxM0RFMzlGOjFBQTNEREM6Njk2OUFFRUUiLCJ2aXNpdG9yX2lkIjoiNTAxNDM5NTQ2NzAwNDQzMzc0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | dee726ebb7e6e58f00a587eed86837474413fe4b4dbea91de816654528d59f0f |
| hovercard-subject-tag | issue:440684379 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/gitpython-developers/GitPython/871/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9cf3c762bd94440ec1902c325747a80d4459a418d2d0a7605a62a0e541af804f/gitpython-developers/GitPython/issues/871 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9cf3c762bd94440ec1902c325747a80d4459a418d2d0a7605a62a0e541af804f/gitpython-developers/GitPython/issues/871 |
| og:image:alt | 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 t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | t89 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b23b8fcc855cd29bb04d6c94aafa62d336bf44eefa8229444eecc968cad03aee |
| turbo-cache-control | no-preview |
| go-import | github.com/gitpython-developers/GitPython git https://github.com/gitpython-developers/GitPython.git |
| octolytics-dimension-user_id | 503709 |
| octolytics-dimension-user_login | gitpython-developers |
| octolytics-dimension-repository_id | 1126087 |
| octolytics-dimension-repository_nwo | gitpython-developers/GitPython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1126087 |
| octolytics-dimension-repository_network_root_nwo | gitpython-developers/GitPython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0672399d88424758731ec07fe24509e23bb17fb5 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width