Skip to content

Commit b3a4f85

Browse files
dschogitster
authored andcommitted
bash completion: add diff options
I use "git diff" (the porcelain) really often, and am almost as often annoyed that the completions do not know how to complete something simple as --cached. Now they do. Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c67bbc5 commit b3a4f85

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,20 @@ _git_describe ()
551551

552552
_git_diff ()
553553
{
554+
local cur="${COMP_WORDS[COMP_CWORD]}"
555+
case "$cur" in
556+
--*)
557+
__gitcomp "--cached --stat --numstat --shortstat --summary
558+
--patch-with-stat --name-only --name-status --color
559+
--no-color --color-words --no-renames --check
560+
--full-index --binary --abbrev --diff-filter
561+
--find-copies-harder --pickaxe-all --pickaxe-regex
562+
--text --ignore-space-at-eol --ignore-space-change
563+
--ignore-all-space --exit-code --quiet --ext-diff
564+
--no-ext-diff"
565+
return
566+
;;
567+
esac
554568
__git_complete_file
555569
}
556570

0 commit comments

Comments
 (0)