git.c: update NO_PARSEOPT markings

Our Bash completion script can complete --options for commands using parse-options even when that command doesn't have a dedicated completion function, but to do so the completion script must know which commands use parse-options and which don't. Therefore, commands not using parse-options are marked in 'git.c's command list with the NO_PARSEOPT flag. Update this list, and remove this flag from the commands that by now use parse-options. After this change we can TAB complete --options of the plumbing commands 'commit-tree', 'mailinfo' and 'mktag'. Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

SZEDER Gábor committed Aug 19, 2022 at 18:03 UTC 66fa6e8ed8bcfff6708d7bceed4c2b9e4050ebe7
1 file changed +5 -5
git.c
+5 -5
@@ -489,14 +489,14 @@ static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
489 static struct cmd_struct commands[] = {
490 { "add", cmd_add, RUN_SETUP | NEED_WORK_TREE },
491 { "am", cmd_am, RUN_SETUP | NEED_WORK_TREE },
492 - { "annotate", cmd_annotate, RUN_SETUP | NO_PARSEOPT },
492 + { "annotate", cmd_annotate, RUN_SETUP },
493 { "apply", cmd_apply, RUN_SETUP_GENTLY },
494 { "archive", cmd_archive, RUN_SETUP_GENTLY },
495 { "bisect--helper", cmd_bisect__helper, RUN_SETUP },
496 { "blame", cmd_blame, RUN_SETUP },
497 { "branch", cmd_branch, RUN_SETUP | DELAY_PAGER_CONFIG },
498 { "bugreport", cmd_bugreport, RUN_SETUP_GENTLY },
499 - { "bundle", cmd_bundle, RUN_SETUP_GENTLY | NO_PARSEOPT },
499 + { "bundle", cmd_bundle, RUN_SETUP_GENTLY },
500 { "cat-file", cmd_cat_file, RUN_SETUP },
501 { "check-attr", cmd_check_attr, RUN_SETUP },
502 { "check-ignore", cmd_check_ignore, RUN_SETUP | NEED_WORK_TREE },
@@ -514,7 +514,7 @@ static struct cmd_struct commands[] = {
514 { "column", cmd_column, RUN_SETUP_GENTLY },
515 { "commit", cmd_commit, RUN_SETUP | NEED_WORK_TREE },
516 { "commit-graph", cmd_commit_graph, RUN_SETUP },
517 - { "commit-tree", cmd_commit_tree, RUN_SETUP | NO_PARSEOPT },
517 + { "commit-tree", cmd_commit_tree, RUN_SETUP },
518 { "config", cmd_config, RUN_SETUP_GENTLY | DELAY_PAGER_CONFIG },
519 { "count-objects", cmd_count_objects, RUN_SETUP },
520 { "credential", cmd_credential, RUN_SETUP_GENTLY | NO_PARSEOPT },
@@ -553,7 +553,7 @@ static struct cmd_struct commands[] = {
553 { "ls-files", cmd_ls_files, RUN_SETUP },
554 { "ls-remote", cmd_ls_remote, RUN_SETUP_GENTLY },
555 { "ls-tree", cmd_ls_tree, RUN_SETUP },
556 - { "mailinfo", cmd_mailinfo, RUN_SETUP_GENTLY | NO_PARSEOPT },
556 + { "mailinfo", cmd_mailinfo, RUN_SETUP_GENTLY },
557 { "mailsplit", cmd_mailsplit, NO_PARSEOPT },
558 { "maintenance", cmd_maintenance, RUN_SETUP | NO_PARSEOPT },
559 { "merge", cmd_merge, RUN_SETUP | NEED_WORK_TREE },
@@ -566,7 +566,7 @@ static struct cmd_struct commands[] = {
566 { "merge-recursive-theirs", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE | NO_PARSEOPT },
567 { "merge-subtree", cmd_merge_recursive, RUN_SETUP | NEED_WORK_TREE | NO_PARSEOPT },
568 { "merge-tree", cmd_merge_tree, RUN_SETUP },
569 - { "mktag", cmd_mktag, RUN_SETUP | NO_PARSEOPT },
569 + { "mktag", cmd_mktag, RUN_SETUP },
570 { "mktree", cmd_mktree, RUN_SETUP },
571 { "multi-pack-index", cmd_multi_pack_index, RUN_SETUP },
572 { "mv", cmd_mv, RUN_SETUP | NEED_WORK_TREE },