git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Andrew SayersNext: Junio C Hamano
Message 5 of 8 in “bash-completion: Print a useful error when called in a non-bash shell”
  1. bash-completion: Print a useful error when called in a non-bash shellAndrew Sayers, Jul 28, 2010
  2. Junio C HamanoJul 29, 2010
  3. solsTiCe d'HiverJul 29, 2010
  4. Andrew SayersJul 29, 2010
  5. Ævar Arnfjörð BjarmasonJul 29, 2010
  6. Junio C HamanoJul 29, 2010
  7. Stephen BoydJul 30, 2010
  8. Johannes SixtAug 6, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.