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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Kyle J. McKay" <mackyle@xxxxxxxxx> 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/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]