Thread (115 messages) flat view 115 messages, 4 authors, 2018-12-11
STALE2844d

Revision v2 of 2 in this series.

Revisions (2)
  1. v2 current
  2. v3 [diff vs current]

[PATCH v2 41/41] completion: use __gitcomp_builtin in _git_worktree

From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2018-01-31 11:09:23
Subsystem: the rest · Maintainer: Linus Torvalds

The new completable options for "worktree add" are:

--checkout
--guess-remote
--lock
--track

Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
---
 builtin/worktree.c                     | 2 +-
 contrib/completion/git-completion.bash | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 4d3422f62e..76dc6b8cb5 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -367,7 +367,7 @@ static int add(int ac, const char **av, const char *prefix)
 	struct option options[] = {
 		OPT__FORCE(&opts.force,
 			   N_("checkout <branch> even if already checked out in other worktree"),
-			   0),
+			   PARSE_OPT_NOCOMPLETE),
 		OPT_STRING('b', NULL, &opts.new_branch, N_("branch"),
 			   N_("create a new branch")),
 		OPT_STRING('B', NULL, &new_branch_force, N_("branch"),
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 179ddd8c44..cfd24c5764 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -3004,16 +3004,16 @@ _git_worktree ()
 	else
 		case "$subcommand,$cur" in
 		add,--*)
-			__gitcomp "--detach"
+			__gitcomp_builtin worktree_add
 			;;
 		list,--*)
-			__gitcomp "--porcelain"
+			__gitcomp_builtin worktree_list
 			;;
 		lock,--*)
-			__gitcomp "--reason"
+			__gitcomp_builtin worktree_lock
 			;;
 		prune,--*)
-			__gitcomp "--dry-run --expire --verbose"
+			__gitcomp_builtin worktree_prune
 			;;
 		*)
 			;;
-- 
2.16.1.205.g271f633410
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help