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 neede).

This makes --rerere-autoupdate completable for am, cherry-pick and
revert.

Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]>
---
 contrib/completion/git-completion.bash | 3 +--
 parse-options.h                        | 4 ++--
 rerere.h                               | 3 +--
 3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/contrib/completion/git-completion.bash 
b/contrib/completion/git-completion.bash
index 0ddf40063b..c310b241d3 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -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
diff --git a/parse-options.h b/parse-options.h
index 0ba08691e6..ab1cc362bf 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -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 }
diff --git a/rerere.h b/rerere.h
index 5e5a312e4c..c2961feaaa 100644
--- 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
-- 
2.16.1.435.g8f24da2e1a

Reply via email to