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

Re: [PATCH v2 3/3] completion: collapse extra --no-.. options

From
Duy Nguyen <pclouds@gmail.com>
Date
May 29, 2018, 19:04 UTC
Message-ID
<CACsJy8Cq8LaFf=fvU02e4aepOUXC8CUTFeiUVHVvzYk50AqmVA@mail.gmail.com>
In-Reply-To
<CAGZ79kZ+kDRHKJj917rZ-=mmusuTcB4_Su-BNupqdQqT6rWRaQ@mail.gmail.com>
On Tue, May 29, 2018 at 8:48 PM, Stefan Beller <sbeller@google.com> wrote:
Show 34 quoted lines
> On Sun, May 27, 2018 at 1:38 AM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
>> The commands that make use of --git-completion-helper feature could
>> now produce a lot of --no-xxx options that a command can take. This in
>> many case could nearly double the amount of completable options, using
>> more screen estate and also harder to search for the wanted option.
>>
>> This patch attempts to mitigate that by collapsing extra --no-
>> options, the ones that are added by --git-completion-helper and not in
>> original struct option arrays. The "--no-..." option will be displayed
>> in this case to hint about more options, e.g.
>>
>>     > ~/w/git $ git clone --
>>     --bare                 --origin=
>>     --branch=              --progress
>>     --checkout             --quiet
>>     --config=              --recurse-submodules
>>     --depth=               --reference=
>>     --dissociate           --reference-if-able=
>>     --filter=              --separate-git-dir=
>>     --hardlinks            --shallow-exclude=
>>     --ipv4                 --shallow-since=
>>     --ipv6                 --shallow-submodules
>>     --jobs=                --shared
>>     --local                --single-branch
>>     --mirror               --tags
>>     --no-...               --template=
>>     --no-checkout          --upload-pack=
>>     --no-hardlinks         --verbose
>>     --no-tags
>
> https://public-inbox.org/git/20180527083828.6919-1-pclouds@gmail.com/
> " There's no magic numbers (previously we keep 3 --no- options)"
>
> Here I see 3 no- options, is the number how many no's to show configurable now?

In a sense, yes. If you write OPT_BOOL(0, "no-foo",...) then that --no-foo _always_ shows. "git clone" just happens to have three of them.

-- 
Duy
Previous: Stefan BellerNext: Nguyễn Thái Ngọc Duy
Message 18 of 23 in “completion: complete all possible -no-<options>”
  1. completion: complete all possible -no-<options>Nguyễn Thái Ngọc Duy, Apr 17, 2018
  2. Junio C HamanoApr 18, 2018
  3. Duy NguyenApr 18, 2018
  4. Eric SunshineApr 23, 2018
  5. Duy NguyenMay 8, 2018
  6. Stefan BellerMay 8, 2018
  7. Aaron SchrabMay 9, 2018
  8. Duy NguyenMay 14, 2018
  9. Eric SunshineMay 14, 2018
  10. Duy NguyenMay 14, 2018
  11. Andreas HeidukMay 14, 2018
  12. Duy NguyenMay 14, 2018
  13. Andreas HeidukMay 14, 2018
  14. 0/3 completion: complete all possible -no-<options>Nguyễn Thái Ngọc Duy, May 27, 2018
  15. 1/3 parse-options: option to let --git-completion-helper show negative formNguyễn Thái Ngọc Duy, May 27, 2018
  16. 3/3 completion: collapse extra --no-.. optionsNguyễn Thái Ngọc Duy, May 27, 2018
  17. Stefan BellerMay 29, 2018
  18. Duy NguyenMay 29, 2018
  19. 2/3 completion: suppress some -no- optionsNguyễn Thái Ngọc Duy, May 27, 2018
  20. 0/3 ompletion: complete all possible -no-<options>Nguyễn Thái Ngọc Duy, Jun 6, 2018
  21. 2/3 completion: suppress some -no- optionsNguyễn Thái Ngọc Duy, Jun 6, 2018
  22. 1/3 parse-options: option to let --git-completion-helper show negative formNguyễn Thái Ngọc Duy, Jun 6, 2018
  23. 3/3 completion: collapse extra --no-.. optionsNguyễn Thái Ngọc Duy, Jun 6, 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.