]> git.ipfire.org Git - thirdparty/git.git/commitdiff
contrib/completion: complete options that take refs for format-patch
authorDenton Liu <liu.denton@gmail.com>
Thu, 17 Sep 2020 08:04:36 +0000 (01:04 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Sep 2020 22:23:22 +0000 (15:23 -0700)
The completion for format-patch currently suggests --base=, --interdiff=
and --range-diff= as options. However, with these `=` forms of the
options, there is no space and we'd enter the `--*` case which means we
don't call the __git_complete_revlist() at the end.

Teach _git_format_patch() to complete refs in the case of --base=,
--interdiff= and --range-diff=.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index 9147fba3d5c34e617f94129b02459d4579595da8..8be4a0316e603f759580960144a163aa80d9332b 100644 (file)
@@ -1784,6 +1784,10 @@ _git_format_patch ()
                        " "" "${cur##--thread=}"
                return
                ;;
+       --base=*|--interdiff=*|--range-diff=*)
+               __git_complete_refs --cur="${cur#--*=}"
+               return
+               ;;
        --*)
                __gitcomp_builtin format-patch "$__git_format_patch_extra_options"
                return