bash completion lacks options

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

bash completion lacks options

Olaf Hering-3
"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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: bash completion lacks options

Ævar Arnfjörð Bjarmason
On Mon, Sep 7, 2015 at 5:07 PM, Olaf Hering <[hidden email]> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: bash completion lacks options

Olaf Hering-3
Am 07.09.2015 um 17:34 schrieb Ævar Arnfjörð Bjarmason:
> On Mon, Sep 7, 2015 at 5:07 PM, Olaf Hering <[hidden email]> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: bash completion lacks options

Ævar Arnfjörð Bjarmason
On Mon, Sep 7, 2015 at 5:36 PM, Olaf Hering <[hidden email]> wrote:

> Am 07.09.2015 um 17:34 schrieb Ævar Arnfjörð Bjarmason:
>> On Mon, Sep 7, 2015 at 5:07 PM, Olaf Hering <[hidden email]> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: bash completion lacks options

Olaf Hering-3
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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|

Re: bash completion lacks options

Junio C Hamano
In reply to this post by Ævar Arnfjörð Bjarmason
Ævar Arnfjörð Bjarmason <[hidden email]> writes:

> On Mon, Sep 7, 2015 at 5:36 PM, Olaf Hering <[hidden email]> wrote:
>> Am 07.09.2015 um 17:34 schrieb Ævar Arnfjörð Bjarmason:
>>> On Mon, Sep 7, 2015 at 5:07 PM, Olaf Hering <[hidden email]> 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.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html