Skip to contentSkip to conversation

bash completion lacks options

DISCUSSION Olaf Hering 3 participants 6 messages Jun 15, 2016

lore
Share & tools
lore
#1 lore raw
Quoted 2 lines · Olaf Hering

"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! :)

Quoted 5 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.

#3 lore raw
Quoted 10 lines · Olaf Hering

Am 07.09.2015 um 17:34 schrieb Ævar Arnfjörð Bjarmason:

Quoted 6 lines · Olaf Hering
Quoted 2 lines

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.

#4 lore raw

Am 08.09.2015 um 13:28 schrieb Ævar Arnfjörð Bjarmason:

Quoted 2 lines

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

#5 lore raw
In reply to Ævar Arnfjörð Bjarmason
Quoted 6 lines · Ævar Arnfjörð Bjarmason
Quoted 5 lines · Olaf Hering

Am 07.09.2015 um 17:34 schrieb Ævar Arnfjörð Bjarmason:

Quoted 4 lines · Olaf Hering
Quoted 2 lines

https://github.com/libguestfs/libguestfs/commit/0306c98d319d189281af3c15101c8d343e400f13

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

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.