progress bars appear when running from cron

Bug #42197 reported by David Kowis
8
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
John A Meinel

Bug Description

It is necessary to silence the progress bars when one is running commands within cron. That way I only get notifications if something doesn't work right.

Thanks

Revision history for this message
Martin Pool (mbp) wrote :

Confirmed, I've been seeing this myself.

The intended behaviour is that progress bars should only be shown if connected to a terminal, which is not the case when run from cron. There must be a bug in how this is done.

Changed in bzr:
status: Unconfirmed → Confirmed
Revision history for this message
Olaf Conradi (olaf-conradi) wrote :

Would be nice to also suppress the progressbar when piped:

20:13 < robey> has this already been reported? with knits, if i do "bzr diff" through less, it still tries to display a progress bar (which just comes out as garbage at the top of the diff)

Revision history for this message
Martin Pool (mbp) wrote :

On the other hand the progress bar could be useful with

  bzr diff > foo.diff

but on the whole it would be better to suppress it.

So this suggests the rule would be - show progress if stdout *and* stderr are ttys?

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 42197] Re: progress bars appear when running from cron

On Tue, 2006-05-02 at 01:24 +0000, Martin Pool wrote:
> On the other hand the progress bar could be useful with
>
> bzr diff > foo.diff
>
> but on the whole it would be better to suppress it.
>
> So this suggests the rule would be - show progress if stdout *and* stderr are ttys?

What about just stderr ?

We can use stderr to get the terminal width, and if that fails (stderr
isn't a tty) switch to a SilentProgressBar in the TextUIFactory. Note
that we should not change the UI Factory to be SilentUIFactory because
we still want warnings etc output.

Rob

--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
Martin Pool (mbp) wrote :

On 02/05/2006, at 12:10 PM, Robert Collins wrote:
>
> What about just stderr ?

That would not satisfy Robey's case (quoted above by oohlaf) of "bzr
diff | less" -- here stderr is still a tty.

--
Martin

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 42197] Re: [Bug 42197] Re: progress bars appear when running from cron

On Tue, 2006-05-02 at 04:11 +0000, Martin Pool wrote:
> On 02/05/2006, at 12:10 PM, Robert Collins wrote:
> >
> > What about just stderr ?
>
> That would not satisfy Robey's case (quoted above by oohlaf) of "bzr
> diff | less" -- here stderr is still a tty.

Surely Robey cannot have been doing that, or he would not have got
progress bar fluff in the captured output ?

Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
Robey Pointer (robey) wrote :

I was using an alias which sends both stdout/stderr through less, so detecting if stderr is a tty would work for my case.

however, in the case of "bzr diff | less", dumping stuff to stderr will just spam on top of your less output, making yout hit ^L until it stops. (this is why i have the alias.) :)

Revision history for this message
Robert Collins (lifeless) wrote :

Theres more than just progress bars that appear during cron runs:

Using saved location: sftp://chinstrap/home/warthogs/archives/rocketfuel.knits/launchpad/devel
0 revision(s) pushed.

For instance. This is why I think a -q global option (i.e. bzr -q push) which would disable all not-part-of-the-users-request output, such as progress bars, and ui hints like 'using saved location' and 'x revisions pushed.'

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 42197] Re: progress bars appear when running from cron

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
| Theres more than just progress bars that appear during cron runs:
|
| Using saved location:
sftp://chinstrap/home/warthogs/archives/rocketfuel.knits/launchpad/devel
| 0 revision(s) pushed.

|
| For instance. This is why I think a -q global option (i.e. bzr -q
push) which would disable all not-part-of-the-users-request output, such
as progress bars, and ui hints like 'using saved location' and 'x
revisions pushed.'

That might be -qq. I like having messages like that in my cron logs,
but obviously, I don't want progress bars.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEWVBV0F+nu1YWqI0RAhkKAJ0T3j7J6G9/8rCloTLxanDJ1w3RtwCePt++
l8ds/+ptE4EarT9pj8Z3Bn4=
=Ge45
-----END PGP SIGNATURE-----

Revision history for this message
Peter Amstutz (tetron) wrote :

This is particularly annoying, since the progress bar does to stderr (?) so the obvious fix of simply redirecting stdout to /dev/null doesn't work.

Revision history for this message
Michael Ellerman (michael-ellerman) wrote :

.. but the obvious fix of redirecting stderr to /dev/null would work right? bzr foo 2> /dev/null ?

Revision history for this message
John A Meinel (jameinel) wrote :

setting the environment var BZR_PROGRESS_BAR='none' will disable progress bars. (Or force it to dots with BZR_PROGRESS_BAR='dots', or even 'tty')

Changed in bzr:
assignee: nobody → jameinel
status: Confirmed → Fix Committed
John A Meinel (jameinel)
Changed in bzr:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.