completion: don't set PARSE_OPT_NOCOMPLETE on --rerere-autoupdate
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>
Nguyễn Thái Ngọc Duy committed
Mar 7, 2018 at 08:05 UTC
b475e442e8ec64e77acd7cb8c9c9bb321a76e82d
3 files changed
+5
-6
contrib/completion/git-completion.bash
+2
-2
@@ -1754,8 +1754,7 @@ _git_merge ()
1754
1755
case "$cur" in
1756
--*)
1757
- __gitcomp_builtin merge "--rerere-autoupdate
1758
- --no-rerere-autoupdate
1757
+ __gitcomp_builtin merge "--no-rerere-autoupdate
1758
--no-commit --no-edit --no-ff
1759
--no-log --no-progress
1760
--no-squash --no-stat
@@ -1963,6 +1962,7 @@ _git_rebase ()
1962
--autostash --no-autostash
1963
--verify --no-verify
1964
--keep-empty --root --force-rebase --no-ff
1965
+ --rerere-autoupdate
1966
--exec
1967
"
1968
parse-options.h
+2
-2
@@ -148,8 +148,8 @@ struct option {
148
#define OPT_STRING_LIST(s, l, v, a, h) \
149
{ OPTION_CALLBACK, (s), (l), (v), (a), \
150
(h), 0, &parse_opt_string_list }
151
-#define OPT_UYN(s, l, v, h, f) { OPTION_CALLBACK, (s), (l), (v), NULL, \
152
- (h), PARSE_OPT_NOARG|(f), &parse_opt_tertiary }
151
+#define OPT_UYN(s, l, v, h) { OPTION_CALLBACK, (s), (l), (v), NULL, \
152
+ (h), PARSE_OPT_NOARG, &parse_opt_tertiary }
153
#define OPT_DATE(s, l, v, h) \
154
{ OPTION_CALLBACK, (s), (l), (v), N_("time"),(h), 0, \
155
parse_opt_approxidate_cb }
rerere.h
+1
-2
@@ -37,7 +37,6 @@ extern void rerere_clear(struct string_list *);
37
extern void rerere_gc(struct string_list *);
38
39
#define OPT_RERERE_AUTOUPDATE(v) OPT_UYN(0, "rerere-autoupdate", (v), \
40
- N_("update the index with reused conflict resolution if possible"), \
41
- PARSE_OPT_NOCOMPLETE)
40
+ N_("update the index with reused conflict resolution if possible"))
41
42
#endif