Lars Wirzenius wrote:
> I run mr from cron. This works fine, since all branches I am mirroring
> are publically available. I get an e-mail from cron every few hours,
> which contains the output of mr. I have to scan this manually to see if
> (and what) went wrong. Using the -q option does not significantly reduce
> the amount of text I need to scan.
> 
> It would be really handy for me to have a --really-quiet option (by
> whatever name), which would suppress all output, unless something went
> wrong. Possibly just outputting a single line saying all went OK (and N
> branches were updated). This way, I could spend a few less brain cycles
> on dealing with this output.
> 
> Actually, now that I think of it, it might be possible to generalize
> this: a command called something like
> suppress-output-unless-there-was-an-error that would capture stdout and
> stderr and print nothing if the command exited with 0, else print
> everything.
> 
> Joey, would you prefer mr --really-quiet or a command to submit to
> moreutils? I'd be happy to submit a patch for either.

Well, I use the following in my .mrconfig to sorta deal with this:

# This hack is here because git pull stupidly outputs tag info to stderr.
# Shut it up but let real errors through, for use in cron.
quietupdate = mr -s -n update 3>&1 1>/dev/null 2>&3 | egrep -v '(storing 
tag|tag: )' || true

Git seemed, to me, to be the main offender for unnecessary logging to
stderr. So I filed a bug on it (#447395). The new git --quiet does seem
to nicely suppress all output in at least usual cases.

Anyway, I think that for mr, it would make sense for the -q option to supress
all output unless a command errored.

-- 
see shy jo

Attachment: signature.asc
Description: Digital signature

Reply via email to