]> git.ipfire.org Git - thirdparty/git.git/commitdiff
completion: complete some 'git log' options
authorKIYOTA Fumiya <aimluck.kiyota@gmail.com>
Mon, 20 Oct 2025 17:32:57 +0000 (17:32 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Oct 2025 18:07:24 +0000 (11:07 -0700)
1. '--exclude=' option to 'git log' and 'git shortlog' are missing. Add the
option to __git_log_shortlog_options.

2. The `--committer` option in `git log` requires a pattern, such as
`--committer=ba`, but in `git shortlog`, specifying a pattern results in
an error: “error: option `committer' takes no value.” Handle them as
separate options for completion rather than a shared one.

Signed-off-by: KIYOTA Fumiya <aimluck.kiyota@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash

index e3d88b06721b3910faf5bd4bfb3f14ebca46b870..73abea31b428f3ce21f05992da87ec38e7d99a06 100644 (file)
@@ -2218,7 +2218,7 @@ __git_log_gitk_options="
 "
 # Options that go well for log and shortlog (not gitk)
 __git_log_shortlog_options="
-       --author= --committer= --grep=
+       --author= --grep= --exclude=
        --all-match --invert-grep
 "
 # Options accepted by log and show
@@ -2296,6 +2296,7 @@ __git_complete_log_opts ()
                        $__git_log_shortlog_options
                        $__git_log_gitk_options
                        $__git_log_show_options
+                       --committer=
                        --root --topo-order --date-order --reverse
                        --follow --full-diff
                        --abbrev-commit --no-abbrev-commit --abbrev=
@@ -3229,7 +3230,7 @@ _git_shortlog ()
                __gitcomp "
                        $__git_log_common_options
                        $__git_log_shortlog_options
-                       --numbered --summary --email
+                       --committer --numbered --summary --email
                        "
                return
                ;;