git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] bash: Add more long options to be completed with "git --<TAB>"

From
TLTeemu Likonen <tlikonen@iki.fi>
Date
Mar 6, 2008, 16:52 UTC
Message-ID
<1204822357-10210-1-git-send-email-tlikonen@iki.fi>
Add the following long options to be completed with command "git":
	--paginate
	--work-tree=
	--help
Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
---

I'm not at all expert in bash completion code but this seems to work and can be useful.

 contrib/completion/git-completion.bash |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 49e6df0..1198547 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1194,11 +1194,14 @@ _git ()
 		case "${COMP_WORDS[COMP_CWORD]}" in
 		--*=*) COMPREPLY=() ;;
 		--*)   __gitcomp "
+			--paginate
 			--no-pager
 			--git-dir=
 			--bare
 			--version
 			--exec-path
+			--work-tree=
+			--help
 			"
 			;;
 		*)     __gitcomp "$(__git_commands) $(__git_aliases)" ;;
-- 
1.5.4.3.451.g43956
Message 1 of 1 in “bash: Add more long options to be completed with "git --<TAB>"”
  1. bash: Add more long options to be completed with "git --<TAB>"Teemu Likonen, Mar 6, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.