summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-11-23 01:11:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-11-29 00:20:31 (GMT)
commitb3a4f8586b4ffa6c896cf0afb2ea49d64faf81ad (patch)
tree8abeb55a53ac056f76f0ea8f943238ec6a8daa4e
parentc67bbc55f0310de79647457b1fa2a5d3b1746488 (diff)
downloadgit-b3a4f8586b4ffa6c896cf0afb2ea49d64faf81ad.zip
git-b3a4f8586b4ffa6c896cf0afb2ea49d64faf81ad.tar.gz
git-b3a4f8586b4ffa6c896cf0afb2ea49d64faf81ad.tar.bz2
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>
-rwxr-xr-xcontrib/completion/git-completion.bash14
1 files changed, 14 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 599b2fc..58e0e53 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -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
}