Thread (44 messages) 44 messages, 5 authors, 2021-10-26

[PATCH v5 0/3] send-email: shell completion improvements

STALE1802d

From: Thiago Perrotta <hidden>
Date: 2021-09-24 02:47:05

Revision v5 of 7 in this series.

Revisions (7)
  1. v2 [diff vs current]
  2. v3 [diff vs current]
  3. v4 [diff vs current]
  4. v5 current
  5. v6 [diff vs current]
  6. v7 [diff vs current]
  7. v8 [diff vs current]
"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, generating them programmatically.

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


Differences from V4:

Incorporate Carlo Arenas' and Ævar Arnfjörð Bjarmason's suggestion to
programatically generate the flags.

I tried to be concise whilst preserving readability, hopefully it's
straightforward to parse the current implementation.


Reviewers of previous versions:

- Bagas Sanjaya
- Carlo Arenas
- Junio Hamano
- Ævar Arnfjörð Bjarmason


Ævar wrote earlier:
Note: using --in-reply-to to the previous version in "git format-patch"
helps keep track of the context.
Thanks for the heads up, I am slowly getting used to this email
workflow, this is my first contribution. Hopefully I got it right this
time.
Isn't this just:
my @params = <getopts list>;
GetOptions(@params);
Let me know if the regex approach I went with is OK. You seem to have
suggested me to do something with the `GetOptions` module, but I'm
afraid I only know the basics of Perl.

I tried to do something like `GetOptions($USAGE)` but it didn't quite
work (clearly I have no idea how to do that :P). If you have something
specific in mind, I'd appreciate if you could send a small patch back
that I can incorporate. Otherwise, either way, the current regex
approach isn't too horrible and seems to be reasonably reliable.

Thiago Perrotta (3):
  send-email: terminate --git-completion-helper with LF
  send-email: programmatically generate bash completions
  send-email docs: add format-patch options

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

-- 
2.33.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help