Separate progress-reporting stream

Vincent Ladeuil v.ladeuil+lp at free.fr
Wed Jun 17 16:53:43 BST 2009


>>>>> "Eric" == Eric Siegerman <lists08-bzr at davor.org> writes:

    Eric> 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,

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

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


Sounds good to me (and, without looking at the code, the actual
design should make that pretty easy to implement), but I'm not
the coder ;-)

    Vincent



More information about the bazaar mailing list