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

2 messages from 2009-03-21 to 2009-03-23. Participants: Kevin McConnell, Shawn O. Pearce.
Thread: https://gitlist.dev/t/18458

## Kevin McConnell, 2009-03-21 23:29

Subject: [PATCH] Add --staged to bash completion for git diff
Message-ID: <372194e70903211629w52705806l5a82c2dde19b73f7@mail.gmail.com>
URL: https://gitlist.dev/e/372194e70903211629w52705806l5a82c2dde19b73f7%40mail.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

```

## Shawn O. Pearce, 2009-03-23 00:33

Subject: Re: [PATCH] Add --staged to bash completion for git diff
Message-ID: <20090323003341.GJ23521@spearce.org>
URL: https://gitlist.dev/e/20090323003341.GJ23521%40spearce.org
In-Reply-To: <372194e70903211629w52705806l5a82c2dde19b73f7@mail.gmail.com>

```
Kevin McConnell <kevin.mcconnell@gmail.com> wrote:
> The --staged option (synonym for --cached) isn't listed in the
> completion choices for git diff.  This tiny patch adds it.

Missing Signed-off-by line?

Otherwise though,

Trivially-Acked-by: Shawn O. Pearce <spearce@spearce.org>

> ---
>  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
>  			"

-- 
Shawn.

```
