Skip to content

RemoteProgress update broken while fetching #1

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
yiikou opened this issue Oct 28, 2024 · 0 comments
Open

RemoteProgress update broken while fetching #1

yiikou opened this issue Oct 28, 2024 · 0 comments

Comments

@yiikou
Copy link
Owner

yiikou commented Oct 28, 2024

Used version

Git: 2.34.1
GitPython: 3.1.43
Python: 3.10.12
FYI, progress bar rendered with rich (13.7.1)

Issue

RemoteProgress update method is called with ill-formed parameters when use with remote.fetch and thus leading to broken progress bar. This is working well with clone and/or clone_from. Update is called only once per git operation (e.g. COUNTING, COMPRESSING) with BEGIN and END opcode flag set and all messages concatenated.
It seems that remote progress lines are not parsed correctly while fetching remote.

Correct behavior with clone

Cloning git repository mypackage (revision=branch1)...
  Counting    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% eta 0:00:00                       
  Compressing ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% eta 0:00:00                       
  Receiving   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% eta 0:00:00 6.45 MiB | 12.85 MiB/s
  Resolving   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% eta 0:00:00                       

Broken progress bar with fetch

Updating mypackage (revision=main)...
Count… remote: Counting objects:   1% (6/592)        remote: Counting objects:   2% (12/592)        remote: Counting objects:   3% (18/592)        remote: Counting objects:   4% (24/59…
Compr… remote: Compressing objects:   1% (3/240)        remote: Compressing objects:   2% (5/240)        remote: Compressing objects:   3% (8/240)        remote: Compressing objects:  …
Recei… Receiving objects:  77% (456/592)Receiving objects:  78% (462/592)Receiving objects:  79% (468/592)Receiving objects:  80% (474/592)Receiving objects:  81% (480/592)Receiving ob…
Resol… Resolving deltas:   1% (5/406)Resolving deltas:   2% (9/406)Resolving deltas:   3% (13/406)Resolving deltas:   4% (17/406)Resolving deltas:   5% (21/406)Resolving deltas:   6% (…

yiikou referenced this issue Oct 28, 2024
See gitpython-developers#1969

stderr parser call RemoteProgress update on each line received.
With universal_newlines set to False, there is a mixup between
line feed and carriage return.
In the `handle_process_output` thread, this is thus seen as a single
line for the whole output on each steps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant