On Thu, Aug 16, 2018 at 8:42 PM Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> wrote: > > The PARSE_OPT_HIDDEN is, per the documentation of the "option" struct > in option parse-options.h, only supposed to affect -h output, not > completion. That's what the PARSE_OPT_NOCOMPLETE flag is supposed to > be for. > > Since 2e29dca66a ("completion: use __gitcomp_builtin in _git_commit", > 2018-02-09) we've been using e.g. "git commit --git-completion-helper" > to get the bash completion for the git-commit command. Due to > PARSE_OPT_HIDDEN this excluded e.g. --allow-empty and > --allow-empty-message. > > Now, this wasn't a behavior change in that commit. Before that we had > a hardcoded list of options, removed in 2e29dca66a ("completion: use > __gitcomp_builtin in _git_commit", 2018-02-09). This list didn't > contain those two options. > > But as noted in the follow-up discussion to c9b5fde759 ("Add option to > git-commit to allow empty log messages", 2010-04-06) in > https://public-inbox.org/git/20100406055530.GE3901@xxxxxxxxxxxxxxxxxxxxxxx/ > the motivation for PARSE_OPT_HIDDEN was to keep the "git commit -h" > output to a minimum, not to hide it from completion. > > I think it makes sense to exclude options like these from -h output, > but for the completion the user is usually not trying to complete "git > commit --<TAB>", Actually I do :) > but e.g. "git commit --allo<TAB>", and because of this behavior we don't show these options at all there. And it would be great if these options do not show up at --<tab> but do when with --a<tab>. We already do something similar to this with --no-<tab>. So this could be another option. -- Duy