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

[PATCH] Add --staged to bash completion for git diff

From
KMKevin McConnell <kevin.mcconnell@gmail.com>
Date
Mar 21, 2009, 23:29 UTC
Message-ID
<372194e70903211629w52705806l5a82c2dde19b73f7@mail.gmail.com>
The --staged option (synonym for --cached) isn't listed in the
completion choices for git diff.  This tiny patch adds it.
---
 contrib/completion/git-completion.bash |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/contrib/completion/git-completion.bash
b/contrib/completion/git-completion.bash
index ed235f7..6bc32df 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -899,7 +899,7 @@ _git_diff ()
 	local cur="${COMP_WORDS[COMP_CWORD]}"
 	case "$cur" in
 	--*)
-		__gitcomp "--cached --pickaxe-all --pickaxe-regex
+		__gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
 			--base --ours --theirs
 			$__git_diff_common_options
 			"
-- 
1.6.2.1
Next: Shawn O. Pearce
Message 1 of 2 in “Add --staged to bash completion for git diff”
  1. Add --staged to bash completion for git diffKevin McConnell, Mar 21, 2009
  2. Shawn O. PearceMar 23, 2009

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.