git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2] completion: use builtin completion for format-patch

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 1, 2018, 23:52 UTC
Message-ID
<xmqqzhuss6dd.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CACsJy8AowaAW91wGMYbC8aTOB1NoqQN-5NGx=qUCHp0i6zQRDA@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 10 quoted lines
>> > I have no comment about this. In an ideal world, sendemail.perl could
>> > be taught to support --git-completion-helper but I don't think my
>> > little remaining Perl knowledge (or time) is enough to do it. Perhaps
>> > this will do. I don't know.
>>
>> So "all", "attach", etc. are added to this list while these similar
>> options are lost from the other variable?  Is this a good trade-off?
>
> Not sure if I understand you correctly, but it looks to me that the
> options in git-send-email.perl are well organized, so we could...

Yes, but I wasn't commenting on your "sendemail should also be able to help completion by supporting --completion-helper option" (I think that is a sensible approach). My comment was about Denton's patch, which reduced the hard-coded list of format-patch options (i.e. the first hunk) but had to add back many of them to send-email's completion (i.e. the last hunk)---overall, it did not help reducing the number of options hardcoded in the script.

If it makes sense to complete all options to format-patch to send-email, then as you outlined, grabbing them out of format-patch with the --completion-helper option at runtime, and using them to complete both format-patch and send-email would be a good idea. And that should be doable even before send-email learns how to list its supported options to help the completion.

Show 9 quoted lines
> --git-completon-helper in that script to print all send-email specific
> options, then call "git format-patch --git-completion-helper" to add a
> bunch more. The options that are handled by setup_revisions() will
> have to be maintained manually here like $__git_format_patch_options
> and added on top in both _git_send_email () and _git_format_patch ().
>
> So, nothing option is lost and by the time setup_revisions() supports
> -git-completion-helper, we can get rid of the manual shell variable
> too. The downside is, lots of work, probably.
Previous: Duy NguyenNext: Duy Nguyen
Message 9 of 13 in “completion: use builtin completion for format-patch”
  1. completion: use builtin completion for format-patchDenton Liu, Oct 29, 2018
  2. Junio C HamanoOct 30, 2018
  3. Denton LiuOct 30, 2018
  4. completion: use builtin completion for format-patchDenton Liu, Oct 30, 2018
  5. Junio C HamanoOct 30, 2018
  6. Duy NguyenOct 30, 2018
  7. Junio C HamanoNov 1, 2018
  8. Duy NguyenNov 1, 2018
  9. Junio C HamanoNov 1, 2018
  10. Duy NguyenNov 3, 2018
  11. Denton LiuNov 3, 2018
  12. Duy NguyenNov 3, 2018
  13. Junio C HamanoNov 3, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.