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

Matthew D. Fuller fullermd at over-yonder.net
Wed Jun 17 17:33:20 BST 2009


On Wed, Jun 17, 2009 at 11:21:44AM -0400 I heard the voice of
Eric Siegerman, and lo! it spake thus:
> 
> 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.

Quite.  Aside from programs that do it from necessity (e.g., tty
control programs), the only thing I use that does that that I can
think of is [Open]SSH, and it does it for paranoic security reasons.
Certainly neither apply here.  Really, any program that I

% program >> /dev/null 2>&1

and ends up still putting stuff on my terminal had better have a
*REALLY* good reason for reaching around under the covers like that...


> 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.

So off the wall it would do no good at all  ;).  Anything the user
does with stderr (redirects, closes, leaves alone) would do the same
thing to your output there.  From the outside, it would look just like
it were fprintf(STDERR)'d in the first place.


-- 
Matthew Fuller     (MF4839)   |  fullermd at over-yonder.net
Systems/Network Administrator |  http://www.over-yonder.net/~fullermd/
           On the Internet, nobody can hear you scream.



More information about the bazaar mailing list