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

Re: [PATCH/RFC] completion: complete all possible -no-<options>

From
Eric Sunshine <sunshine@sunshineco.com>
Date
May 14, 2018, 03:33 UTC
Message-ID
<CAPig+cRUD7FnJqSZ=hkz0GAgOROiY+gvHKRjKVfkKtqDZyt5mA@mail.gmail.com>
In-Reply-To
<CACsJy8BGs7EOYFKayL-bgvEbKOJiROF52o3SneLyG9Nm6nUngA@mail.gmail.com>
On Tue, May 8, 2018 at 11:24 AM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 17 quoted lines
> On Mon, Apr 23, 2018 at 7:36 AM, Eric Sunshine <sunshine@sunshineco.com> wrote:
>> I haven't looked at the implementation, so this may be an entirely
>> stupid suggestion, but would it be possible to instead render the
>> completions as?
>>
>>     % git checkout --<tab>
>>     --[no-]conflict=                   --[no-]patch
>>     --[no-]detach                      --[no-]progress
>>
>> This would address the problem of the --no-* options taking double the
>> screen space.
>
> It took me so long to reply partly because I remember seeing some guy
> doing clever trick with tab completion that also shows a short help
> text in addition to the complete words. I could not find that again
> and from my reading (also internet searching) it's probably not
> possible to do this without trickery.
Okay.
Show 6 quoted lines
>> It's also more intuitive than that lone and somewhat weird-looking
>> "--no-" suggestion.
>
> It's not that weird if you think about file path completion, where you
> complete one path component at a time not full path, bash just does
> not show you full paths to everything.

The "path completion" analogy and the dotted configuration variable analogy (below) don't really help me find "--no-" less weird. We're used to "/" as a separator in paths, and "." a separator in configuration variables, so they are easier to digest than "-" somehow being a separator for --no-<option>.

It _might_ feel as bit less weird if it was presented as --no-<option> or --no-{...} or --no-<...> or --no-... or something, but those seem pretty weird too, so perhaps not. Anyhow, it's not a major issue; the --[no-]foo idea seems pretty intuitive, but if it can't be easily implemented, then falling back to your --no- idea makes sense.

Show 13 quoted lines
> I'm arguing about this because I want to see your reaction, because
> I'm thinking of doing the very same thing for config completion. Right
> now "git config <tab>" gives you two pages of all available config
> variables. I'm thinking that we "git config <tab>" just shows the
> groups, e.g.
>
>> ~/w/git $ git config
> add.              interactive.
> advice.           log.
> alias.            mailmap.
> am.               man.
>
> Only when you do "git config log.<tab>" that it shows you log.*

Just wondering out loud (again): add.<var> | add.{...} | add.<...> | add...; those aren't very attractive either, so plain "add." may indeed be best.

Previous: Duy NguyenNext: Duy Nguyen
Message 9 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.