]> git.ipfire.org Git - thirdparty/git.git/commitdiff
completion: complete "git -<TAB>" with short options
authorWiktor Mis <mwiktor023@gmail.com>
Wed, 26 Nov 2025 16:26:31 +0000 (16:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 26 Nov 2025 17:55:55 +0000 (09:55 -0800)
"git" itself has completion for its long options and subcommands,
but not for its short options.  Add support for them.

Signed-off-by: Wiktor Mis <mwiktor023@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index 73abea31b428f3ce21f05992da87ec38e7d99a06..1705ca33234b9fbbc7d0ecd3e445161b1bb63b85 100644 (file)
@@ -3898,7 +3898,7 @@ __git_main ()
                        ;;
                esac
                case "$cur" in
-               --*)
+               -*)
                        __gitcomp "
                        --paginate
                        --no-pager
@@ -3914,6 +3914,12 @@ __git_main ()
                        --namespace=
                        --no-replace-objects
                        --help
+                       -C
+                       -P
+                       -c
+                       -h
+                       -p
+                       -v
                        "
                        ;;
                *)