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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Schindelin committed
Nov 23, 2007 at 01:11 UTC
b3a4f8586b4ffa6c896cf0afb2ea49d64faf81ad
1 file changed
+14
contrib/completion/git-completion.bash
+14
@@ -551,6 +551,20 @@ _git_describe ()
551
552
_git_diff ()
553
{
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
568
__git_complete_file
569
}
570