Re: A note on modern git plus ancient meld ("wrong number of arguments")
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Feb 10, 2012, 17:59 UTC
- Message-ID
- <20120210175915.GB19216@burratino>
- In-Reply-To
- <CAHGBnuPBDO=tnoDFGOcGz4nZh9O_A803STmj7KALLuhwgf=hCg@mail.gmail.com>
Hi,
Sebastian Schuberth wrote:
> On Fri, Feb 10, 2012 at 09:23, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 5 quoted lines
>> + meld_version=${meld_version#GNOME }
>> + meld_version=${meld_version#* }
>
> Hmm, I might be mistaken, but aren't these string operations
> Bash-only? And AFAIK Git is striving for standard sh compatibility ...They are widely supported in POSIX-style shells. See [1] and Documentation/CodingGuidelines:
- We use POSIX compliant parameter substitutions and avoid bashisms; namely:
- We use ${parameter-word} and its [-=?+] siblings, and their
colon'ed "unset or null" form. - We use ${parameter#word} and its [#%] siblings, and their
doubled "longest matching" form.A good way to catch these things is to try with dash or posh, which are a little less full-featured than bash and ksh.
Thanks for looking it over. Jonathan
[1] http://pubs.opengroup.org/onlinepubs/9699919799/ Search for "sh -".