monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] status --brief


From: Nathaniel Smith
Subject: Re: [Monotone-devel] status --brief
Date: Mon, 3 Oct 2005 01:30:49 -0700
User-agent: Mutt/1.5.9i

On Sat, Oct 01, 2005 at 12:51:14PM -0500, Chad Walstrom wrote:
> Nathaniel Smith <address@hidden>  wrote:
> > Ah, okay, actually I think that particular thing is a bug in --brief
> > -- IMO it should print "no changes" if there are no changes, similar
> > to what 'monotone diff' does.
> 
> Hmm...  It all depends upon which philosophies you follow for UI
> design.  Are you trying to follow UNIX design philosophy, "succeed
> silently" or the Windows philosophy, more of a "succeed or fail, just
> do it loudly."
> 
> "no changes" would be an example of succeeding loudly. ;-)

Oh, well, I see 'status' as having a rather specific use case: a
person is asking the computer to provide some information on a
particular object.  It's not about success or failure; it's about
clearly providing information.  Responding with nothing to a query
tends to make humans nervous.

> > Does that change your opinion either way?
> 
> Because monotone status always returns zero (0), having "no changes"
> for an output is probably the only way to get meaning out of the
> command for use in scripts, although the lack of output has meaning in
> and of itself.  Instead of outputting "no changes", I would like to
> see some thought given to the return values for monotone.

There is some difference, actually, since "" is "" in any language,
but "no changes" varies with the locale.  This is yet another reason
why trying to parse such output is probably not a great approach,
though, and there's the "automate" system to let people avoid that...

Scripts _can_ figure out whether there are local changes by parsing
the working copy's revision text ("automate get_revision" with no
arguments).  In this respect you're no worse off than with the current
output format, so this is probably a separable discussion.

At the moment, monotone return values are:
  0: no errors
  1: error occurred
  2: gave help output
  3: crashed
Which seems reasonable enough for most cases.  It's not clear to me
that 'status' should be an exception.  It _does_ seem like it'd be
handy for shell scripts if there was a way to do this (and maybe some
other simple boolean queries) via some sort of exit code thing...

Not sure how well that would fit in with automate, though, those
commands are all designed to take command arguments and output text,
'automate stdio' doesn't make much sense otherwise...

-- Nathaniel

-- 
"But in Middle-earth, the distinct accusative case disappeared from
the speech of the Noldor (such things happen when you are busy
fighting Orcs, Balrogs, and Dragons)."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]