git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "KIYOTA Fumiya via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Revi Ewer <revi.ewer@example.com>,
	Ill Takalook <ill.takalook@example.net>,
	KIYOTA Fumiya <kiyota-f@asahi.com>,
	KIYOTA Fumiya <aimluck.kiyota@gmail.com>
Subject: [PATCH v2] completion: complete some 'git log' options
Date: Mon, 20 Oct 2025 17:32:57 +0000	[thread overview]
Message-ID: <pull.2073.v2.git.git.1760981577441.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.2073.git.git.1760878666840.gitgitgadget@gmail.com>

From: KIYOTA Fumiya <aimluck.kiyota@gmail.com>

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>
---
    completion: complete some 'git log' options
    
    Change since v1:
    
     * Make the commit message follow the Git project’s style.
    
    v1:
    
     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.” Therefore,
        I’ll handle them as separate options for completion rather than a
        shared one.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2073%2FFKbelm%2FlogCompletion-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2073/FKbelm/logCompletion-v2
Pull-Request: https://github.com/git/git/pull/2073

Range-diff vs v1:

 1:  2887b0e6c9 ! 1:  d8edd3653a completion: complete some 'git log' options
     @@ Commit message
      
          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.” Therefore, I’ll
     -    handle them as separate options for completion rather than a shared one.
     +    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>
      


 contrib/completion/git-completion.bash | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index e3d88b0672..73abea31b4 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -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
 		;;

base-commit: 4253630c6f07a4bdcc9aa62a50e26a4d466219d1
-- 
gitgitgadget

  parent reply	other threads:[~2025-10-20 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-19 12:57 [PATCH] completion: complete some 'git log' options KIYOTA Fumiya via GitGitGadget
2025-10-19 16:07 ` Junio C Hamano
2025-10-20 17:27   ` 清田郁弥
2025-10-20 17:32 ` KIYOTA Fumiya via GitGitGadget [this message]
2025-10-20 18:08   ` [PATCH v2] " Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.2073.v2.git.git.1760981577441.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=aimluck.kiyota@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ill.takalook@example.net \
    --cc=kiyota-f@asahi.com \
    --cc=revi.ewer@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).