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

Re: bash completion broken on ubuntu 10.10?

From
Kevin Ballard <kevin@sb.org>
Date
Oct 21, 2010, 04:44 UTC
Message-ID
<15A9C855-A450-467F-9502-9ADA3D59F64F@sb.org>
In-Reply-To
<20101020225018.46f7e70e@montecarlo.grandprix.int>
On Oct 20, 2010, at 7:50 PM, Peter van der Does wrote:
Show 40 quoted lines
> On Thu, 21 Oct 2010 01:04:09 +0200
> SZEDER Gábor <szeder@ira.uka.de> wrote:
> 
>> Hi,
>> 
>> Git's bash completion script offers possible arguments to some
>> options, e.g. it lists pretty formats after 'git log --pretty=<TAB>',
>> merge tools after 'git mergetool --tool=<TAB>', refs after 'git commit
>> --reuse-message=<TAB>', etc.
>> 
>> On a three day old ubuntu 10.10 install these don't work anymore; the
>> completion script offers the list of files in all those cases.
>> 
>> After a bit of investigation I found that when I press TAB after 'git
>> log --pretty=', then ${COMP_WORDS[COMP_CWORD-1]} contains '--pretty'
>> and ${COMP_WORDS[COMP_CWORD]} contains "=".  Weird.
>> 
>> Then I remembered that we had some COMP_WORDBREAKS issues in the past
>> (db8a9ff, bash completion: Resolve git show ref:path<tab> losing ref:
>> portion, 2008-07-15)).  So I looked at my $COMP_WORDBREAKS, but didn't
>> see anything suspicious (it contains "'><=;|&(: ).  Removing the '='
>> makes the listing after 'git log --pretty=' work, but breaks many
>> other things badly.
>> 
>> I don't have any ideas what could possibly be wrong here (but it's too
>> late here for any bright ideas anyway...).  Could someone confirm or
>> deny this behaviour on ubuntu 10.10?
>> 
>> 
>> Thanks,
>> Gábor
>> 
> 
> My guess is that it has to do with Bash 4, the equal sign must be seen
> as a new word. I'm running Ubuntu 10.04 and have the same problem.
> I fixed the problem locally, I just don't know if that works on Bash 3
> and I doubt it will work on Bash 3.
> 
> I changed the script only for git log, not other commands yet, like 
> git am --whitespace=<tab><tab>
Looks like you're right. I'm running bash 4.1.7 on OS X and it's broken here.
-Kevin Ballard
Previous: Peter van der DoesNext: Mathias Lafeldt
Message 4 of 5 in “bash completion broken on ubuntu 10.10?”
  1. SZEDER GáborOct 20, 2010
  2. Brian GernhardtOct 20, 2010
  3. Peter van der DoesOct 21, 2010
  4. Kevin BallardOct 21, 2010
  5. Mathias LafeldtOct 21, 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.