git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Sebastian Schuberth <sschuberth@gmail.com>
Cc: David Aguilar <davvid@gmail.com>,
	Jeff Epler <jepler@unpythonic.net>,
	git@vger.kernel.org, Charles Bailey <charles@hashpling.org>
Subject: Re: A note on modern git plus ancient meld ("wrong number of arguments")
Date: Fri, 10 Feb 2012 11:59:15 -0600	[thread overview]
Message-ID: <20120210175915.GB19216@burratino> (raw)
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:

>> +       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 -".

  reply	other threads:[~2012-02-10 17:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-09 19:17 A note on modern git plus ancient meld ("wrong number of arguments") Jeff Epler
2012-02-10  2:42 ` David Aguilar
2012-02-10  8:23   ` Jonathan Nieder
2012-02-10 11:29     ` Sebastian Schuberth
2012-02-10 17:59       ` Jonathan Nieder [this message]
2012-02-10 21:28     ` Junio C Hamano
2012-02-10 21:57       ` [PATCH] mergetools/meld: Use --help output to detect --output support Jonathan Nieder
2012-02-10 22:23         ` Jeff Epler
2012-02-10 22:30         ` Jeff Epler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120210175915.GB19216@burratino \
    --to=jrnieder@gmail.com \
    --cc=charles@hashpling.org \
    --cc=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jepler@unpythonic.net \
    --cc=sschuberth@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).