Web lists-archives.com

[PATCH 2/2] completion: simplify _git_notes




This also adds completion for 'git notes remove' with two options:
--ignore-missing and --stdin.

For some strange reason, 'git notes undefined --<tab>' completes --ref
without even running --git-completion-helper. But since this is an error
case (and we're not doing anything destructive, it's probably ok for now)

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
---
 contrib/completion/git-completion.bash | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index c310b241d3..ab80f4e6e8 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1836,19 +1836,8 @@ _git_notes ()
 	add,--reedit-message=*|append,--reedit-message=*)
 		__git_complete_refs --cur="${cur#*=}"
 		;;
-	add,--*)
-		__gitcomp_builtin notes_add
-		;;
-	append,--*)
-		__gitcomp_builtin notes_append
-		;;
-	copy,--*)
-		__gitcomp_builtin notes_copy
-		;;
-	prune,--*)
-		__gitcomp_builtin notes_prune
-		;;
-	prune,*)
+	*,--*)
+		__gitcomp_builtin notes_$subcommand
 		;;
 	*)
 		case "$prev" in
-- 
2.16.1.435.g8f24da2e1a