Skip to content

Commit b475e44

Browse files
pcloudsgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fc3d4e0 commit b475e44

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

contrib/completion/git-completion.bash

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,8 +1754,7 @@ _git_merge ()
17541754

17551755
case "$cur" in
17561756
--*)
1757-
__gitcomp_builtin merge "--rerere-autoupdate
1758-
--no-rerere-autoupdate
1757+
__gitcomp_builtin merge "--no-rerere-autoupdate
17591758
--no-commit --no-edit --no-ff
17601759
--no-log --no-progress
17611760
--no-squash --no-stat
@@ -1963,6 +1962,7 @@ _git_rebase ()
19631962
--autostash --no-autostash
19641963
--verify --no-verify
19651964
--keep-empty --root --force-rebase --no-ff
1965+
--rerere-autoupdate
19661966
--exec
19671967
"
19681968

parse-options.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ struct option {
148148
#define OPT_STRING_LIST(s, l, v, a, h) \
149149
{ OPTION_CALLBACK, (s), (l), (v), (a), \
150150
(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 }
153153
#define OPT_DATE(s, l, v, h) \
154154
{ OPTION_CALLBACK, (s), (l), (v), N_("time"),(h), 0, \
155155
parse_opt_approxidate_cb }

rerere.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ extern void rerere_clear(struct string_list *);
3737
extern void rerere_gc(struct string_list *);
3838

3939
#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"))
4241

4342
#endif

0 commit comments

Comments
 (0)