incoming exit status

Matt Schulte matts at commtech-fastcom.com
Wed Nov 10 16:39:57 CST 2010


On Wed, Nov 10, 2010 at 1:50 PM, Matt Mackall <mpm at selenic.com> wrote:
> On Wed, 2010-11-10 at 20:08 +0100, Jason Harris wrote:
>> Personally, I still feel that a valid command, that has executed in a valid way, returning a valid result of (nothing) should have an exit code of 0.
>
> Simply put, you're wrong. The grep command was created on March 3, 1973,
> so there's decades of historical and standards precedent for giving
> useful exit codes.
>
> There's also now half a decade of precedent _in Mercurial itself_ and
> people in this very thread have already pointed out that they depend on
> that behavior.

To be fair I think you are being a bit harsh.  There are plenty of
reasons why a non-zero exit status would be considered an error.  For
instance:

http://www.gnu.org/software/bash/manual/html_node/Exit-Status.html
http://en.wikipedia.org/wiki/Exit_status#C
http://en.wikipedia.org/wiki/Exit_status#Java
http://en.wikipedia.org/wiki/Exit_status#Unix
http://tldp.org/LDP/abs/html/exit-status.html

In my opinion I believe that returning an non-zero exit status should
equate to an error.

Though at the same time I think it is perfectly fine to say "sorry
that's just the way it is in Mercurial, so deal with it."

Matt Schulte


More information about the Mercurial mailing list