"bzr annotate": extracting X/Y/X

Martin Pool mbp at sourcefrog.net
Mon Nov 28 00:00:28 UTC 2011


On 26 November 2011 21:30, Eli Zaretskii <eliz at gnu.org> wrote:
> When I run "bzr annotate", it shows this cryptic message while it
> works:
>
>  extracting 0/666/666
>
> (the numbers vary depending on the file being annotated).  What are
> those numbers?

The progress bar shows a stack of internal operations within the
actual command you ran.  Here bzr is extracting versions of the file
so it can diff them and generate the annotations; I expect there are
666 distinct versions we have to look at.

I don't know why there are three numbers; as far as I'm aware we only
ever generate x/y, 0<=x<=y.  There may be some screen corruption that
has made the 666 stay behind (I think you filed a separately bug like
that.)  Updating content on a text terminal is inherently a bit
dangerous - we could probably do better - perhaps we should explicitly
erase the rest of the line.

I was thinking about this the other day and I think there are two ways
we could possibly improve progress indicators:

1- Squash the nerdy internal phase stuff (perhaps unless specifically
requested) and just show a description of the over all user-centered
operation, for example "annotating foo.c" with a spinner and progress
bar.

This is probably pretty easy if someone wants to try.

2- At the moment we send some output to stdout and some to stderr and
we try to keep them both in sync for the fairly common case that
they're both going to the same terminal.  This seems a bit complicated
and perhaps it's not always working well, and possibly we should only
draw progress when both streams are a tty and presumably the same tty,
and then we can just write to stdout.

I don't know if this specifically fixes any cases; it's probably not
the most important bug; just something I thought of.

-- 
Martin



More information about the bazaar mailing list