Skip to content

Commit

Permalink
bash completion: add diff options
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Nov 29, 2007
1 parent c67bbc5 commit b3a4f85
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,20 @@ _git_describe ()

_git_diff ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--*)
__gitcomp "--cached --stat --numstat --shortstat --summary
--patch-with-stat --name-only --name-status --color
--no-color --color-words --no-renames --check
--full-index --binary --abbrev --diff-filter
--find-copies-harder --pickaxe-all --pickaxe-regex
--text --ignore-space-at-eol --ignore-space-change
--ignore-all-space --exit-code --quiet --ext-diff
--no-ext-diff"
return
;;
esac
__git_complete_file
}

Expand Down

0 comments on commit b3a4f85

Please sign in to comment.