Spurious characters displayed by bzr-git

Bug #754539 reported by Eli Zaretskii on 2011-04-08
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Medium
Unassigned
Breezy
Medium
Unassigned

Bug Description

Whenever I use bzr-git, the first phases ("Counting objects" and "Compressing objects") frequently exhibit some pretty errant behavior, mostly some spurious characters and sometimes extra lines. Here's an example:

    65kB 0kB/s - Counting objects: 112496, done. 0

See that " 0" at the end of the line?

Jelmer Vernooij (jelmer) on 2011-04-12
Changed in bzr-git:
status: New → Triaged
importance: Undecided → Medium
tags: added: ui
Eli Zaretskii (eliz) wrote :

This is still not solved in bzr-git 0.6.2 and dulwich 0.8.0. In the hope to facilitate the solution, I'm adding here the complete comparison between what git shows and what bzr-git shows. (The numbers before each line are for matching outputs of bzr and git.)

Git:

(1)remote: Counting objects: NNN[, done.] # "done" only when done
(2)remote: Compressing objects: NNN% (XXXX/YYYY)[, done.]
(3)remote: Total NNNN (delta xxxx), reused MMMM (delta yyy)
(4)Receiving objects: NNN% (XXXX/YYYY), X.YZ MiB | MM KiB/s[, done.]

Bzr:

(1)XXXkB 0kB/s Counting objects NNNN[, done] 0
(2)XXXkB 0kB/s Compressing objects NNNN/MMMM
(4)XXXkB NNkB/s Compressing objects MMM/MMMM

Notes and observations:
1. Stray "0" in line (1)
2. No equivalent for line (3), or perhaps it flashes too fast (as it is a one-time message and is overwritten by the next one)
3. "Receiving objects" is displayed as "Compressing objects", and the counter does not show progress, but is frozen at the last number of the previous stage.

Jelmer Vernooij (jelmer) wrote :

Can you try this patch?

Jelmer Vernooij (jelmer) wrote :
Eli Zaretskii (eliz) wrote :

Thanks, I think this is on the right track. But there are still some problems.

The display after "bzr pull" now looks like this:

Counting objects: 1
Counting objects: 418
Counting objects: 421, done.
Total 421 (delta 84), reused 335 (delta 53)

The problems are:

1. The "Counting objects" lines don't overwrite each other, as they previously did (and as git does).
2. The "Compressing objects" line is overwritten by "Total NNN ..." line. Git doesn't do that.
3. The "Receiving objects" line still isn't displayed, and instead the "Compressing objects" line keeps being updated. I think this happens because in git this line comes from the client, not from the remote server (it doesn't have the "remote:" prefix). So perhaps bzr-git should produce such a line itself.

There's another problem: sometimes "bzr pull" shows just the byte counts and the spinning bar, with the rest of the line empty. This happens BEFORE the first "Counting objects" line is displayed. I see this regularly with the GDB repo, git://sourceware.org/git/gdb.git.

On Thu, 2011-10-27 at 06:30 +0000, Eli Zaretskii wrote:
> Thanks, I think this is on the right track. But there are still some
> problems.
>
> The display after "bzr pull" now looks like this:
>
> Counting objects: 1
> Counting objects: 418
> Counting objects: 421, done.
> Total 421 (delta 84), reused 335 (delta 53)
>
> The problems are:

> 1. The "Counting objects" lines don't overwrite each other, as they previously did (and as git does).
> 2. The "Compressing objects" line is overwritten by "Total NNN ..." line. Git doesn't do that.
> 3. The "Receiving objects" line still isn't displayed, and instead the "Compressing objects" line keeps being updated. I think this happens because in git this line comes from the client, not from the remote server (it doesn't have the "remote:" prefix). So perhaps bzr-git should produce such a line itself.
Please note that the intention is not to be byte-for-byte compatible
with git in what is output, so I don't really consider these problems
necessarily.

I'd prefer to stay as close as possible to the way bzr itself reports it
progress - by just sticking to the progress bar and updating that and
not printing any other text data. The attached patch fixes basically
works around a bug in bzr's progress bar implementation by falling back
to printing text without progress information outside of the progress
bar.

> There's another problem: sometimes "bzr pull" shows just the byte counts
> and the spinning bar, with the rest of the line empty. This happens
> BEFORE the first "Counting objects" line is displayed. I see this
> regularly with the GDB repo, git://sourceware.org/git/gdb.git.
Counting objects isn't the first step in the process, so it may indeed
be the case that there are other things going on before then. We should
be able to add more progress bar updates for the states before then.

Cheers,

Jelmer

Eli Zaretskii (eliz) wrote :

> I'd prefer to stay as close as possible to the way bzr itself reports it
> progress - by just sticking to the progress bar and updating that and
> not printing any other text data.

Fair enough, but then what is the intended display? "bzr pull" from a bzr repo displays these (AFAICT), each one is preceded by NNNkB XXkB/s and the spinning bar, and possibly followed by a NNN/MMM progress counter:

   Finding revisions
   Fetching revisions:Get stream source
   Fetching revisions:Inserting stream

What do you want to display from bzr-git? I thought the intent was to display these:

   Counting objects
   Compressing objects
   Receiving objects

each one with counters and byte counts, as appropriate. Is this reasonable? If not, what's the alternative?

Jelmer Vernooij (jelmer) wrote :

That is indeed the extension, except Counting objects can't show a progress bar (git doesn't send enough data to do so).

Eli Zaretskii (eliz) wrote :

If you cannot show a progress bar, it's fine with me not to. Just the last snapshot will be fine.

So the only problem, if I understand correctly your plan, is that "Compressing objects" should at some point be overwritten with "Receiving objects", including a progress indicator (the last one of the problems I mentioned above). Everything else seems to be fine as it is.

Thanks.

Jelmer Vernooij (jelmer) on 2011-10-28
affects: bzr-git → bzr
Jelmer Vernooij (jelmer) on 2017-11-09
tags: added: check-for-breezy
Jelmer Vernooij (jelmer) on 2018-09-16
tags: removed: check-for-breezy
tags: added: git
Changed in brz:
status: New → Triaged
importance: Undecided → Medium
status: Triaged → Incomplete
Jelmer Vernooij (jelmer) on 2018-11-25
Changed in brz:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers