threads / patch / 18458

patchAdd --staged to bash completion for git diff

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

## tl;dr

2 messages between Mar 21, 2009 and Mar 23, 2009. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Kevin McConnell· Mar 21, 2009, 23:29 UTC · lore
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(-)
Show changes to contrib/completion/git-completion.bash +1 −1
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· Mar 23, 2009, 00:33 UTC · re: Kevin McConnell · lore

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

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>
Show 18 quoted lines
> ---
>  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.

← back to recent threads