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

Re: Patch for git-completion.bash [SEC=UNCLASSIFIED]

From
DSDavid Scurrah <d.scurrah@bom.gov.au>
Date
Aug 16, 2010, 05:45 UTC
Message-ID
<0E3686EB9FA8AA409AFA0A25468DCE4301309C3DE86C@BOM-VMBX-HO.bom.gov.au>
In-Reply-To
<AANLkTi=QY+3M9jpuwXVcH1-yFhNQrjTfL9epTL-OYGMY@mail.gmail.com>
Thanks reading the list showed running as sh instead of bash was my problem

I am trying to combine the very useful git-prompt (http://volnitsky.com/project/git-prompt/) and git-completion.bash scripts as each had something the other lacked.

The problem is that while git-prompt suggests you start it from .bashrc via [[ $- == *i* ]] && . /path/to/git-prompt.sh

Using . to execute git-completion.bash runs sh which runs bash in sh emulation mode which makes it fail in several places.

I did see a thread about an attempt to make the script zsh compliant as well, I wonder if it would be better to just make it sh compliant so that it is more portable, I guess that's too hard

regards
David Scurrah
Show 29 quoted lines
> >
> > On Mon, 2010-08-16 at 04:14 +0000, Ævar Arnfjörð Bjarmason wrote:
> >> On Mon, Aug 16, 2010 at 04:09, David Scurrah <D.Scurrah@bom.gov.au> wrote:
> >> > Hi,
> >> >
> >> > On Mon, 2010-08-16 at 01:09 +0000, Ævar Arnfjörð Bjarmason wrote:
> >> >> On Mon, Aug 16, 2010 at 00:53, David Scurrah <D.Scurrah@bom.gov.au> wrote:
> >> >>
> >> >> Thanks for not sending a classified patch.
> >> >
> >> > Ha ha - the Australian Government has to have email classifications for
> >> > every email sent - classified I believe just means I do not wish you to
> >> > share it not that it is a state secret (see one implementation
> >> > http://www.janus.net.au/janusSEAL/Outlook/features)
> >> >
> >> >
> >> >> Have you seen the "[bash-completion] syntax error near unexpected
> >> >> token '<' on line 123 in bash_completion.d/git" thread recently on
> >> >> this list? It probably describes the problem you're having.
> >> >
> >> > I'll looked hard and can't find the thread you mentioned
> >> > and the current version on my Fedora system does not complete first
> >> > level commands like checkout ...
> >>
> >> http://comments.gmane.org/gmane.comp.version-control.git/151723
> >>
> >> > Maybe there is something I am missing.
> >>
> >> You're probably executing the completion file in bash's sh compatibility mode.
Previous: Ævar Arnfjörð Bjarmason
Message 3 of 3 in “Patch for git-completion.bash [SEC=UNCLASSIFIED]”
  1. David ScurrahAug 16, 2010
  2. Ævar Arnfjörð BjarmasonAug 16, 2010
  3. David ScurrahAug 16, 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.