threads / discuss / 40293

bash completion lacks options

Subject: bash completion lacks options

## tl;dr

6 messages between Sep 7, 2015 and Sep 8, 2015.

replies: 5people: 3as markdown or json

Olaf Hering· Sep 7, 2015, 15:07 UTC · lore

"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· Sep 7, 2015, 15:34 UTC · re: Olaf Hering · lore

Re: bash completion lacks options

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! :)
Show 5 quoted lines
> 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· Sep 7, 2015, 15:36 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: bash completion lacks options

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· Sep 8, 2015, 11:28 UTC · re: Olaf Hering · lore

Re: bash completion lacks options

On Mon, Sep 7, 2015 at 5:36 PM, Olaf Hering <olaf@aepfle.de> wrote:
Show 10 quoted lines
> 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· Sep 8, 2015, 12:49 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: bash completion lacks options

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· Sep 8, 2015, 18:38 UTC · re: Ævar Arnfjörð Bjarmason · lore

Re: bash completion lacks options

Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
Show 14 quoted lines
> 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.

← back to recent threads