Re: [PATCH] bash-completion: Print a useful error when called in a non-bash shell
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jul 29, 2010, 22:16 UTC
- Message-ID
- <AANLkTikxNe-+tjHkxCk-FtRxLpeyRkx-Wx109iuE+6fL@mail.gmail.com>
- In-Reply-To
- <4C51F2C0.8090101@pileofstuff.org>
On Thu, Jul 29, 2010 at 21:29, Andrew Sayers <andrew-git@pileofstuff.org> wrote:
> On 29/07/10 17:25, Junio C Hamano wrote: >> This looks like a Linux-ism to me. > > Caught red-flippered :) I'll use `ps` next time.
That's also probably hard to get right on all the mutually incompatible *nix ps(1) implementations out there.
As for this patch in general, I think solving this issue in Git's bash-completion code isn't the right thing to do, I think the right thing is to just ignore it and no nothing.
Any given *nix distribution will include lots of non-POSIX and shell-specific initialization files throughout the system. Trying to detect if the shell is running in POSIX compatibility mode in each of these is going to be redundant and bug-prone.
Instead the user should make sure that he's invoking the shell in non-POSIX mode before evaluating non-POSIX code.
Maybe this is a bigger potential problem than it seems, but it seems like just a one-off error in Arch Linux. I'd be surprised if it didn't also break dozens of other packages in Arch which included bash extensions.
This is not a nack, if you want to pursue this and try to emit a friendlier error message that's great. But maybe it's a bit *too* much effort on our part.