# bash completion with 2.18.0/maint: unknown options

3 messages from 2018-07-14 to 2018-07-14. Participants: Дилян Палаузов, Jeff King.
Thread: https://gitlist.dev/t/48885

## Дилян Палаузов, 2018-07-14 14:46

Subject: bash completion with 2.18.0/maint: unknown options
Message-ID: <d9272a12c2a38429857777f7811010956b7b6ed5.camel@aegee.org>
URL: https://gitlist.dev/e/d9272a12c2a38429857777f7811010956b7b6ed5.camel%40aegee.org

```
Hello,

in /git/git I have v2.18.0 and in ~/.bashrc : 
export
PS1='${debian_chroot:+($debian_chroot)}\[\e[01;32m\]\u@\h\[\e[00m\]:\[\
e[
01;34m\]\w\[\e[36m\]$(__git_ps1 " %s")\$ \[\e[0m\]'
source /git/git/contrib/completion/git-completion.bash 
source /git/git/contrib/completion/git-prompt.sh

After upgrading to 2.18 the completion does not work:

typing "git de<TAB>" prints
my@host:~$ git deUnknown option: --list-cmds=list-
mainporcelain,others,nohelpers,alias,list-complete,config
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-
path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [
--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]
l.txt

with l.txt being part of a file called "del.txt"

or typing "git reb<TAB>" I expect to have rebase, but I see
my@myhost:~$ git rebUnknown option: --list-cmds=list-
mainporcelain,others,nohelpers,alias,list-complete,config
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-
path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [
--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

Ideas?

Doing in git/git/ "git checkout v2.17." followed by 'source
/git/git/contrib/completion/git-comletion.bash" does help (makes the
completion functioning).

In the likely case this is fixed by now on master, please backport the
fix soon to the maint branch.

Greetings
  Дилят	


```

## Jeff King, 2018-07-14 21:24

Subject: Re: bash completion with 2.18.0/maint: unknown options
Message-ID: <20180714212433.GB6430@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20180714212433.GB6430%40sigill.intra.peff.net
In-Reply-To: <d9272a12c2a38429857777f7811010956b7b6ed5.camel@aegee.org>

```
On Sat, Jul 14, 2018 at 02:46:17PM +0000, Дилян Палаузов wrote:

> After upgrading to 2.18 the completion does not work:
> 
> typing "git de<TAB>" prints
> my@host:~$ git deUnknown option: --list-cmds=list-
> mainporcelain,others,nohelpers,alias,list-complete,config
> usage: git [--version] [--help] [-C <path>] [-c name=value]
> [...]

In v2.18, the completions are generated programatically using new
options added to the git binary. The completion and the git binary
you're using have to be upgraded in lockstep (this has always been the
case, though I think this is probably the case where not doing so would
have the biggest effect).

Are you sure the git binary you're running matches the completion?

You mentioned that you're sourcing the completion from a clone in
/git/git. What does `type git` report?

-Peff

```

## Дилян Палаузов, 2018-07-14 21:38

Subject: Re: bash completion with 2.18.0/maint: unknown options
Message-ID: <05bba1ef0a5da7662cc8c09f90bacc9059eeac05.camel@aegee.org>
URL: https://gitlist.dev/e/05bba1ef0a5da7662cc8c09f90bacc9059eeac05.camel%40aegee.org
In-Reply-To: <20180714212433.GB6430@sigill.intra.peff.net>

```
Hello Jeff,

thanks for your answer.  You are right: I have forgotten to run 'make
install'.  After doing so the completion works again.

type git reports /usr/local/bin/git

Regards
  Дилян

On Sat, 2018-07-14 at 17:24 -0400, Jeff King wrote:
> On Sat, Jul 14, 2018 at 02:46:17PM +0000, Дилян Палаузов wrote:
> 
> > After upgrading to 2.18 the completion does not work:
> > 
> > typing "git de<TAB>" prints
> > my@host:~$ git deUnknown option: --list-cmds=list-
> > mainporcelain,others,nohelpers,alias,list-complete,config
> > usage: git [--version] [--help] [-C <path>] [-c name=value]
> > [...]
> 
> In v2.18, the completions are generated programatically using new
> options added to the git binary. The completion and the git binary
> you're using have to be upgraded in lockstep (this has always been the
> case, though I think this is probably the case where not doing so would
> have the biggest effect).
> 
> Are you sure the git binary you're running matches the completion?
> 
> You mentioned that you're sourcing the completion from a clone in
> /git/git. What does `type git` report?
> 
> -Peff


```
