Subject: Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD

From: Junio C Hamano <[email-masked]>
Date: Wed, 16 Apr 2014 11:23:18 -0700

Junio C Hamano <[email-masked]> writes:

> By the way, you have this in your log message:
>
>     ... the git-rebase--*.sh scripts have used a "return" to return
>     from the "dot" command that runs them.  While this is allowed by
>     POSIX,...
>
>
> Is it "this is allowed", or is it "this should be the way and shells
> that do not do so are buggy"?

Answering myself...

The only "unspecified" I see is this:

    If the shell is not currently executing a function or dot
    script, the results are unspecified.

which clearly does not apply to the version before this patch (we
are executing a dot script).  And

    The return utility shall cause the shell to stop executing the
    current function or dot script.

would mean that we are correct to expect that "should not get here"
is not reached, as the "return 5" would cause the shell to stop
executing the dot script there.

So "while this is allowed by POSIX" may be a bit misleading and
needs to be reworded, I guess?