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

[PATCH] completion: clarify support for short options and arguments

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 7, 2025, 01:03 UTC
Message-ID
<xmqqzf7vm7b7.fsf@gitster.g>

The list of supported completions in the header of the file was mostly written a long time ago when Shawn added the initial version of this script in 2006. The list explicitly states that we complete "common --long-options", which implies that we do not complete not-so-common ones and single letter options (this text dates back to May 2007).

Update the description to explicitly state that single-letter options are not completed. Also, document that arguments to options are completed, even for single-letter options (e.g., "git -c <TAB>" offers configuration variables).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 contrib/completion/git-completion.bash | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git c/contrib/completion/git-completion.bash w/contrib/completion/git-completion.bash
index 73abea31b4..538dff1ee5 100644
--- c/contrib/completion/git-completion.bash
+++ w/contrib/completion/git-completion.bash
@@ -13,7 +13,8 @@
 #    *) git email aliases for git-send-email
 #    *) tree paths within 'ref:path/to/file' expressions
 #    *) file paths within current working directory and index
-#    *) common --long-options
+#    *) common --long-options but not single-letter options
+#    *) arguments to long and single-letter options
 #
 # To use these routines:
 #
Next: Junio C Hamano
Message 1 of 2 in “completion: clarify support for short options and arguments”
  1. completion: clarify support for short options and argumentsJunio C Hamano, Dec 7, 2025
  2. Junio C HamanoDec 7, 2025

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.