Re: [PATCH 1/3] rebase: avoid non-function use of "return" on FreeBSD
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Apr 11, 2014, 08:48 UTC
- Message-ID
- <vpqsipkmeum.fsf@anie.imag.fr>
- In-Reply-To
- <0779303f7d2257a618b5bed00260a8a@74d39fa044aa309eaea14b9f57fe79c>
"Kyle J. McKay" <mackyle@gmail.com> writes:
Show 14 quoted lines
> If script2.sh is changed to this:
>
> # script2.sh fixed
> main() {
> if [ 5 -gt 3 ]; then
> return 5
> fi
> case bad in *)
> echo always shows
> esac
> echo should not get here
> ! :
> }
> mainWouldn't it be better to just stop using . within function?
The .-ed script could define the complete function, and then the function would be used from the toplevel script.
If I understand correctly, your version uses nested functions with file inclusion between both levels of nesting. That might work for the shells you tested, but if the goal is to avoid using tricky features that may trigger bugs on some shells, that seems backward.
IOW, why not move the whole run_specific_rebase_internal function to git-rebase--$type?
-- Matthieu Moy http://www-verimag.imag.fr/~moy/