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

From: Matthieu Moy <[email-masked]>
Date: Fri, 11 Apr 2014 10:48:17 +0200

"Kyle J. McKay" <[email-masked]> writes:

> 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
>         ! :
> }
> main

Wouldn'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/