]> git.ipfire.org Git - thirdparty/git.git/commitdiff
completion: simplify _git_notes
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Wed, 7 Mar 2018 01:05:02 +0000 (08:05 +0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Mar 2018 19:02:48 +0000 (11:02 -0800)
This also adds completion for 'git notes remove' and 'git notes edit'.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index 0d858cacceb54c921e16db99f609b8d1b1163c08..37bf4a64d390d5d3ea7a3fea4ea3cd4ad4e3cf11 100644 (file)
@@ -1836,19 +1836,11 @@ _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
+       *,--*)
+               __gitcomp_builtin notes_$subcommand
                ;;
        prune,*)
+               # this command does not take a ref, do not complete it
                ;;
        *)
                case "$prev" in