[PATCH stable] rebase: add return codes

Martin Geisler mg at aragost.com
Thu May 20 10:05:28 CDT 2010


Jason Harris <jason at jasonfharris.com> writes:

> On May 20, 2010, at 3:41 PM, Martin Geisler wrote:
>
>> If there is nothing to do, then I think that should count as a
>> succesful rebase.
>
> Well... Right now "pull" with nothing to pull returns exit code 1,
> which to me still feels wrong but Matt says it makes it easy to code.
> (I personally don't think this a good reason to issue that exit code.)
>
> In that email thread I started titled "Versioning of external
> extensions?"... Matt Mackall said:
>> For the most part, things work like this:
>> 
>> 0: success
>> 1: nothing to do, unresolved files, no matches, non-fatal errors
>> 255: abort or other exception

Oh, right, I remember that now. That strategy allows one to use '&&' on
the command line to mean 'continue if succesful and something happened'.
Very reasonable.

> [...] I just don't think a pull with nothing to pull should be an
> abnormal error, or indeed a rebase with nothing to do should do an
> "abnormal termination".

Yeah, calling it "abnormal termination" makes it sound worse than it is.
The good old grep(1) has exit code 0 for "lines found", and 1 for "no
lines found", and 2 for error. The grep(1) man page says that posix
mandates an exit code great than 1 in case of error.

-- 
Martin Geisler

aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/


More information about the Mercurial-devel mailing list