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

Re: contrib/completion/git-completion.bash: declare -g is not portable

From
Lucas Werkmeister <mail@lucaswerkmeister.de>
Date
Feb 4, 2018, 11:48 UTC
Message-ID
<f8500cbd-dd40-690b-22e9-a9f6a7d1eb8f@lucaswerkmeister.de>
In-Reply-To
<CAPig+cQXT1ov4MjzSzqiLBzr4wN1XcP7aSxMP+_dhtWtYwhDAA@mail.gmail.com>
On 04.02.2018 10:57, Eric Sunshine wrote:
Show 21 quoted lines
> On Sun, Feb 4, 2018 at 4:45 AM, Duy Nguyen <pclouds@gmail.com> wrote:
>> On Sun, Feb 4, 2018 at 12:20 AM, Torsten Bögershausen <tboegi@web.de> wrote:
>>> After running t9902-completion.sh on Mac OS I got a failure
>>> in this style:
>>
>> Sorry I was new with this bash thingy. Jeff already answered this (and
>> I will fix it in the re-roll) but just for my own information, what
>> bash version is shipped with Mac OS?
> 
> The MacOS bash is very old; note the copyright date:
> 
>     % /bin/bash --version
>     GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16)
>     Copyright (C) 2007 Free Software Foundation, Inc.
> 
> A recent bash installed manually (not from Apple):
> 
>     % /usr/local/bin/bash --version
>     GNU bash, version 4.4.18(1)-release (x86_64-apple-darwin16.7.0)
>     Copyright (C) 2016 Free Software Foundation, Inc.
> 

Specifically, Apple ships the latest version of Bash 3.x, which is the last version published under the GPLv2+ – Bash 4.x switched to GPLv3+. Users can install newer Bash versions themselves, e. g. using Homebrew, but that doesn’t help us here.

Previous: Eric Sunshine
Message 6 of 6 in “contrib/completion/git-completion.bash: declare -g is not portable”
  1. Torsten BögershausenFeb 3, 2018
  2. Andreas SchwabFeb 3, 2018
  3. Jeff KingFeb 3, 2018
  4. Duy NguyenFeb 4, 2018
  5. Eric SunshineFeb 4, 2018
  6. Lucas WerkmeisterFeb 4, 2018

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.