# Completion for aliases that wrap aliases that wrap Git commands

3 messages from 2020-11-06 to 2020-11-10. Participants: Philippe Blain, Felipe Contreras.
Thread: https://gitlist.dev/t/54593

## Philippe Blain, 2020-11-06 22:42

Subject: Completion for aliases that wrap aliases that wrap Git commands
Message-ID: <9717A684-9304-4A65-8566-19F946098455@gmail.com>
URL: https://gitlist.dev/e/9717A684-9304-4A65-8566-19F946098455%40gmail.com

```
Hello all,

I've noticed the following: I have a Git alias that is simply a Git command 
with some options, like

$ git config --get alias.logo
log --abbrev-commit --decorate --format=format:'%C(yellow bold)%h%C(reset) %C(normal)%s%C(reset) %C(dim white)%an%C(reset) %C(dim blue)(%ad)%C(reset) %C(auto)%d%C(reset)'

And another alias that is this previous alias with more options:

$ git config --get alias.lg
logo --first-parent

When typing 'git logo up[TAB][TAB]', the Bash completion script
suggests 'upstream' (like if I type 'git log up[TAB][TAB]'),
but typing 'git lg up[TAB][TAB]' does not suggest anything.

So I'm thinking there is some special logic in the completion script that makes it 
work for simple aliases but not for recursive aliases.

I know nothing about Bash completions, but I'm wondering if that feature would
be possible at all ?

This is on Bash 4.4.19(1) (not that I think it matters very much...)

Cheers,

Philippe.
```

## Felipe Contreras, 2020-11-09 21:56

Subject: Re: Completion for aliases that wrap aliases that wrap Git commands
Message-ID: <CAMP44s3ZPJhej9JQir+Vo6LEQKDfgvJBVyUNPEEze0YTnTxU4g@mail.gmail.com>
URL: https://gitlist.dev/e/CAMP44s3ZPJhej9JQir%2BVo6LEQKDfgvJBVyUNPEEze0YTnTxU4g%40mail.gmail.com
In-Reply-To: <9717A684-9304-4A65-8566-19F946098455@gmail.com>

```
Hello,

On Fri, Nov 6, 2020 at 4:46 PM Philippe Blain
<levraiphilippeblain@gmail.com> wrote:

> I know nothing about Bash completions, but I'm wondering if that feature would
> be possible at all ?

Yeap. I just sent a patch for that:

https://lore.kernel.org/git/20201109215248.461167-1-felipe.contreras@gmail.com/

Cheers.

-- 
Felipe Contreras

```

## Philippe Blain, 2020-11-10 03:01

Subject: Re: Completion for aliases that wrap aliases that wrap Git commands
Message-ID: <6E9B97F3-43AC-431F-9B9C-5962F126F697@gmail.com>
URL: https://gitlist.dev/e/6E9B97F3-43AC-431F-9B9C-5962F126F697%40gmail.com
In-Reply-To: <CAMP44s3ZPJhej9JQir+Vo6LEQKDfgvJBVyUNPEEze0YTnTxU4g@mail.gmail.com>

```
Hi Felipe,

> Le 9 nov. 2020 à 16:56, Felipe Contreras <felipe.contreras@gmail.com> a écrit :
> 
> Hello,
> 
> On Fri, Nov 6, 2020 at 4:46 PM Philippe Blain
> <levraiphilippeblain@gmail.com> wrote:
> 
>> I know nothing about Bash completions, but I'm wondering if that feature would
>> be possible at all ?
> 
> Yeap. I just sent a patch for that:
> 
> https://lore.kernel.org/git/20201109215248.461167-1-felipe.contreras@gmail.com/

Great! thanks.

Philippe.
```
