# bash completion lacks options

6 messages from 2015-09-07 to 2015-09-08. Participants: Olaf Hering, Ævar Arnfjörð Bjarmason, Junio C Hamano.
Thread: https://gitlist.dev/t/40293

## Olaf Hering, 2015-09-07 15:07

Subject: bash completion lacks options
Message-ID: <20150907150757.GA6720@aepfle.de>
URL: https://gitlist.dev/e/20150907150757.GA6720%40aepfle.de

```
"git send-email --f<tab>" lacks --find-renames and others. Is the list
of possible options maintained manually? Perhaps this should be
automated by placing the long strings in an ELF section, then filling
variables like $__git_format_patch_options from such ELF section.
An example how this was done in libguestfs is here (see daemon/daemon.h):
https://github.com/libguestfs/libguestfs/commit/0306c98d319d189281af3c15101c8d343e400f13

Olaf

```

## Ævar Arnfjörð Bjarmason, 2015-09-07 15:34

Subject: Re: bash completion lacks options
Message-ID: <CACBZZX4aZo_hn07Pho2GtBVNWm7WHLbV6xSi_r-BjW97QWNqEg@mail.gmail.com>
URL: https://gitlist.dev/e/CACBZZX4aZo_hn07Pho2GtBVNWm7WHLbV6xSi_r-BjW97QWNqEg%40mail.gmail.com
In-Reply-To: <20150907150757.GA6720@aepfle.de>

```
On Mon, Sep 7, 2015 at 5:07 PM, Olaf Hering <olaf@aepfle.de> wrote:
> "git send-email --f<tab>" lacks --find-renames and others. Is the list
> of possible options maintained manually?

Yes, see contrib/completion/git-completion.bash.

There's no code for send-email there, you (or someone) could submit a patch! :)

> Perhaps this should be
> automated by placing the long strings in an ELF section, then filling
> variables like $__git_format_patch_options from such ELF section.
> An example how this was done in libguestfs is here (see daemon/daemon.h):
> https://github.com/libguestfs/libguestfs/commit/0306c98d319d189281af3c15101c8d343e400f13

This is an interesting approach, but wouldn't help with git-send-email
in particular, it's a Perl script, so there's no ELF section to parse.

```

## Olaf Hering, 2015-09-07 15:36

Subject: Re: bash completion lacks options
Message-ID: <55EDAEF3.7000503@aepfle.de>
URL: https://gitlist.dev/e/55EDAEF3.7000503%40aepfle.de
In-Reply-To: <CACBZZX4aZo_hn07Pho2GtBVNWm7WHLbV6xSi_r-BjW97QWNqEg@mail.gmail.com>

```
Am 07.09.2015 um 17:34 schrieb Ævar Arnfjörð Bjarmason:
> On Mon, Sep 7, 2015 at 5:07 PM, Olaf Hering <olaf@aepfle.de> wrote:

>> https://github.com/libguestfs/libguestfs/commit/0306c98d319d189281af3c15101c8d343e400f13
> 
> This is an interesting approach, but wouldn't help with git-send-email
> in particular, it's a Perl script, so there's no ELF section to parse.

format-patch is a ELF binary, a link to git itself as I notice
just now.

Olaf

```

## Ævar Arnfjörð Bjarmason, 2015-09-08 11:28

Subject: Re: bash completion lacks options
Message-ID: <CACBZZX44qsZZovvJFwP9foqhWaD1ZmL3u+F3hYv2iVq0CKnO6g@mail.gmail.com>
URL: https://gitlist.dev/e/CACBZZX44qsZZovvJFwP9foqhWaD1ZmL3u%2BF3hYv2iVq0CKnO6g%40mail.gmail.com
In-Reply-To: <55EDAEF3.7000503@aepfle.de>

```
On Mon, Sep 7, 2015 at 5:36 PM, Olaf Hering <olaf@aepfle.de> wrote:
> Am 07.09.2015 um 17:34 schrieb Ævar Arnfjörð Bjarmason:
>> On Mon, Sep 7, 2015 at 5:07 PM, Olaf Hering <olaf@aepfle.de> wrote:
>
>>> https://github.com/libguestfs/libguestfs/commit/0306c98d319d189281af3c15101c8d343e400f13
>>
>> This is an interesting approach, but wouldn't help with git-send-email
>> in particular, it's a Perl script, so there's no ELF section to parse.
>
> format-patch is a ELF binary, a link to git itself as I notice
> just now.

Yes, format-patch is written in C, but you mentioned send-email, which
is a Perl script.

```

## Olaf Hering, 2015-09-08 12:49

Subject: Re: bash completion lacks options
Message-ID: <55EED94F.3070603@aepfle.de>
URL: https://gitlist.dev/e/55EED94F.3070603%40aepfle.de
In-Reply-To: <CACBZZX44qsZZovvJFwP9foqhWaD1ZmL3u+F3hYv2iVq0CKnO6g@mail.gmail.com>

```
Am 08.09.2015 um 13:28 schrieb Ævar Arnfjörð Bjarmason:
> Yes, format-patch is written in C, but you mentioned send-email, which
> is a Perl script.

send-mail is handled in my copy of the bash_completion, at the end
the list the format-patch options gets appended. That list could be
autogenerated at build time. Maybe I will find the time to do it myself
at some point.

Olaf

```

## Junio C Hamano, 2015-09-08 18:38

Subject: Re: bash completion lacks options
Message-ID: <xmqqzj0w7o41.fsf@gitster.mtv.corp.google.com>
URL: https://gitlist.dev/e/xmqqzj0w7o41.fsf%40gitster.mtv.corp.google.com
In-Reply-To: <CACBZZX44qsZZovvJFwP9foqhWaD1ZmL3u+F3hYv2iVq0CKnO6g@mail.gmail.com>

```
Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:

> On Mon, Sep 7, 2015 at 5:36 PM, Olaf Hering <olaf@aepfle.de> wrote:
>> Am 07.09.2015 um 17:34 schrieb Ævar Arnfjörð Bjarmason:
>>> On Mon, Sep 7, 2015 at 5:07 PM, Olaf Hering <olaf@aepfle.de> wrote:
>>
>>>> https://github.com/libguestfs/libguestfs/commit/0306c98d319d189281af3c15101c8d343e400f13
>>>
>>> This is an interesting approach, but wouldn't help with git-send-email
>>> in particular, it's a Perl script, so there's no ELF section to parse.
>>
>> format-patch is a ELF binary, a link to git itself as I notice
>> just now.
>
> Yes, format-patch is written in C, but you mentioned send-email, which
> is a Perl script.

I think Olaf means that send-email has a mode where it can drive format-patch
directly from the command line.

This is a slightly related tangent, but I've been wondering if it
makes sense to discourage, deprecate and eventually remove that mode
of operation.  It appears it is the biggest single source of poorly
proof-read series, when compared to "format-patch to a directory
with --cover option and then give them a final scan before running
send-email on them" workflow.

```
