completion: don't set PARSE_OPT_NOCOMPLETE on --rerere-autoupdate
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Wed, 7 Mar 2018 01:05:01 +0000 (08:05 +0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Mar 2018 19:02:48 +0000 (11:02 -0800)
There is not a strong reason to hide this option, and git-merge already
completes this one. Let's allow to complete this for all commands (and
let git-completion.bash do the suppressing if needed).

This makes --rerere-autoupdate completable for am, cherry-pick and
revert. rebase completion is fixed manually because it's a shell
script and does not benefit from --git-completion-helper.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash
parse-options.h
rerere.h
index 0ddf40063b8a9f2cf6d9de26835edac6342467b5..0d858cacceb54c921e16db99f609b8d1b1163c08 100644 (file)
@@ -1754,8 +1754,7 @@ _git_merge ()
 
        case "$cur" in
        --*)
-               __gitcomp_builtin merge "--rerere-autoupdate
-                               --no-rerere-autoupdate
+               __gitcomp_builtin merge "--no-rerere-autoupdate
                                --no-commit --no-edit --no-ff
                                --no-log --no-progress
                                --no-squash --no-stat
@@ -1963,6 +1962,7 @@ _git_rebase ()
                        --autostash --no-autostash
                        --verify --no-verify
                        --keep-empty --root --force-rebase --no-ff
+                       --rerere-autoupdate
                        --exec
                        "
 
index 0ba08691e650db0f519e5a67b647b89ef089a74f..ab1cc362bf2918c28a14dd851c1b1a13dfa0c863 100644 (file)
@@ -148,8 +148,8 @@ struct option {
 #define OPT_STRING_LIST(s, l, v, a, h) \
                                    { OPTION_CALLBACK, (s), (l), (v), (a), \
                                      (h), 0, &parse_opt_string_list }
-#define OPT_UYN(s, l, v, h, f)      { OPTION_CALLBACK, (s), (l), (v), NULL, \
-                                     (h), PARSE_OPT_NOARG|(f), &parse_opt_tertiary }
+#define OPT_UYN(s, l, v, h)         { OPTION_CALLBACK, (s), (l), (v), NULL, \
+                                     (h), PARSE_OPT_NOARG, &parse_opt_tertiary }
 #define OPT_DATE(s, l, v, h) \
        { OPTION_CALLBACK, (s), (l), (v), N_("time"),(h), 0,    \
          parse_opt_approxidate_cb }
index 5e5a312e4c67979306ea9593bcc68a219272beeb..c2961feaaa8a8297d59fb13b120c1a57c8a2868a 100644 (file)
--- a/rerere.h
+++ b/rerere.h
@@ -37,7 +37,6 @@ extern void rerere_clear(struct string_list *);
 extern void rerere_gc(struct string_list *);
 
 #define OPT_RERERE_AUTOUPDATE(v) OPT_UYN(0, "rerere-autoupdate", (v), \
-       N_("update the index with reused conflict resolution if possible"), \
-       PARSE_OPT_NOCOMPLETE)
+       N_("update the index with reused conflict resolution if possible"))
 
 #endif