Thread (1 message) 1 message, 1 author, 2020-08-19

Re: [RFC PATCH 1/2] parse-options: add --git-completion-helper-all

From: Junio C Hamano <hidden>
Date: 2020-08-19 21:05:59

Ryan Zoeller [off-list ref] writes:
On 8/19/20 2:39 PM, Junio C Hamano wrote:
quoted
Ryan Zoeller [off-list ref] writes:
quoted
--git-completion-helper excludes hidden options, such as --allow-empty
for git commit. This is typically helpful, but occasionally we want
auto-completion for obscure flags.
Hits from "git grep -B2 OPT_NOCOMPLETE" tells me that these are
mostly unsafe options.  Those who accept the risk by saying
"complete all" should be allowed to see them.

The same with OPT_HIDDEN (including OPT_HIDDEN_<TYPE>) gives us a
mixed bag.  Many are unsafe, some are uncommon and the rest are
discouraged, or old synonym to some other option that does get
completed.  I am not sure if letting them be completed is an overall
win or makes the output from "git cmd --<TAB><TAB>" too noisy.
If options marked OPT_HIDDEN are considered too internal to
meaningfully expose, I'm happy to hide them. I defaulted to
"show everything", and backing off from that is easy enough.
I think with the current state of HIDDEN which is applied unevenly
and for different purposes, the only sensible thing to do for the
"complete-all" operation is to show them.  If we audit all uses of
hidden and allocate different bit for the reason why they are marked
to be hidden, it may become possible for "complete-all" to be more
intelligent about them (e.g. not showing old synonyms that exist
only for helping muscle memory, while showing others), but before
that, I do not think it makes sense to hide them all.
You're not misreading it; I apparently neglected to test the completion
for '--no-' options with '--git-completion-helper', only
'--git-completion-helper-all'. I'll apply the same show_all logic
to this function.
That makes sense.
I'm inclined to be repetitive in order to keep
'--git-completion-helper-all' intact, e.g. for grepping.
Good reasoning.

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