Separate progress-reporting stream (was Re: bzr with bzr+ssh noisy and output muddled.)

Eric Siegerman lists08-bzr at davor.org
Wed Jun 17 16:21:44 BST 2009


On Wed, 2009-06-17 at 09:53 +1000, Martin Pool wrote:
> 3 - The progress sent to /dev/tty?  That would be different to stderr,

Using /dev/tty takes control away from the user (and,
incidentally, from the test framework, as you point out).  That's
why it's better avoided except in *very* exceptional
circumstances.  (Besides, it's a UNIXism.  Cygwin has it, but
does core Windows?)

OTOH, using /dev/tty would solve the underlying problem -- that
three output streams are wanted, but only two are provided.  The
three are:
 1. the primary output that the user asked for, i.e. stdout
 2. important output that doesn't fall under category 1, but 
    that the user *needs* to see, diagnostics, input prompts,
	etc.
 3. unimportant but useful verbiage, e.g. progress
    reports
  
So here's an off-the-wall idea; bzr could provide the third
stream itself.  At startup, fdup() file descriptor 2 onto
descriptor 3; then write all the progress reports (and any other
unimportant verbiage that might be enabled) to #3.  And of course
make this behaviour official by documenting it.

N.B.: this suggestion is *not* intended to preserve some
hypothetical purity of stderr.  (I'm itching to dive into that
little religious argument, on the side against the OP, but I'll
resist :-))  Rather, it's an attempt to tease out the real,
*technical* problem that's at the core of the OP's complaint, and
to offer a solution.

  - Eric




More information about the bazaar mailing list