mbox series

[v4,0/3] send-email: shell completion improvements

Message ID 20210921155152.4215-1-tbperrotta@gmail.com (mailing list archive)
Headers show
Series send-email: shell completion improvements | expand

Message

Thiago Perrotta Sept. 21, 2021, 3:51 p.m. UTC
"git send-email" completion (bash, zsh) is inconsistent, its flags are
split into both git-completion.bash and git-send-email.perl, and it only
emits format-patch flags.

Make shell completion uniform, centralizing completion
options on git-send-email.perl.

Make "git send-email --git-completion-helper" properly emit send-email
specific options.

Additionally, update git-send-email(1) man page to explicitly
mention format-patch options.

Differences from V3:

- Incorporate Carlo Arenas' code suggestions, adding all flags
  exhaustively.
- Incorporate Bagas Sanjaya's suggestion.

Differences from V2:

- Incorporate Junio's code suggestions.
- Follow proper conventions for git commit messages.

Carlo suggests to generate the flags programatically from the perl
script. I am looking into this and already have a proof-of-concept
working and plan to submit it as a separate patch series. I would like
to get this series checked in first though.

Thiago Perrotta (3):
  send-email: terminate --git-completion-helper with LF
  send-email: move bash completions to core script
  send-email docs: add format-patch options

 Documentation/git-send-email.txt       |  6 ++-
 contrib/completion/git-completion.bash | 11 +----
 git-send-email.perl                    | 64 +++++++++++++++++++++++++-
 t/t9902-completion.sh                  |  3 ++
 4 files changed, 71 insertions(+), 13 deletions(-)

Comments

Ævar Arnfjörð Bjarmason Sept. 23, 2021, 2:02 p.m. UTC | #1
On Tue, Sep 21 2021, Thiago Perrotta wrote:

Note: using --in-reply-to to the previous version in "git format-patch"
helps keep track of the context.

> Carlo suggests to generate the flags programatically from the perl
> script. I am looking into this and already have a proof-of-concept
> working and plan to submit it as a separate patch series. I would like
> to get this series checked in first though.

Isn't this just:

my @params = <getopts list>;
GetOptions(@params);

And then doing some light parsing/slicinng of the @params list to get
the keys you've duplicated here?

I for one would much prefer to see that go in right away than the churn
of first hardcoding these, then removing the hardcoding etc.