summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-02-17 15:25:51 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-02-17 15:25:52 -0800
commitabea4dc76a675d4ac0f27a2367256dc31981d1ca (patch)
tree07020dfe6fce37c742bc73700d651e117891a416 /contrib/completion
parentMerge branch 'mw/bash-prompt-show-untracked-config' (diff)
parentdiff: Introduce --diff-algorithm command line option (diff)
downloadtgif-abea4dc76a675d4ac0f27a2367256dc31981d1ca.tar.xz
Merge branch 'mp/diff-algo-config'
Add diff.algorithm configuration so that the user does not type "diff --histogram". * mp/diff-algo-config: diff: Introduce --diff-algorithm command line option config: Introduce diff.algorithm variable git-completion.bash: Autocomplete --minimal and --histogram for git-diff
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-completion.bash14
1 files changed, 13 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 059ba9d3e4..b62bec0279 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1232,6 +1232,8 @@ _git_describe ()
__gitcomp_nl "$(__git_refs)"
}
+__git_diff_algorithms="myers minimal patience histogram"
+
__git_diff_common_options="--stat --numstat --shortstat --summary
--patch-with-stat --name-only --name-status --color
--no-color --color-words --no-renames --check
@@ -1242,10 +1244,11 @@ __git_diff_common_options="--stat --numstat --shortstat --summary
--no-ext-diff
--no-prefix --src-prefix= --dst-prefix=
--inter-hunk-context=
- --patience
+ --patience --histogram --minimal
--raw
--dirstat --dirstat= --dirstat-by-file
--dirstat-by-file= --cumulative
+ --diff-algorithm=
"
_git_diff ()
@@ -1253,6 +1256,10 @@ _git_diff ()
__git_has_doubledash && return
case "$cur" in
+ --diff-algorithm=*)
+ __gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}"
+ return
+ ;;
--*)
__gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
--base --ours --theirs --no-index
@@ -2058,6 +2065,7 @@ _git_config ()
diff.suppressBlankEmpty
diff.tool
diff.wordRegex
+ diff.algorithm
difftool.
difftool.prompt
fetch.recurseSubmodules
@@ -2331,6 +2339,10 @@ _git_show ()
" "" "${cur#*=}"
return
;;
+ --diff-algorithm=*)
+ __gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}"
+ return
+ ;;
--*)
__gitcomp "--pretty= --format= --abbrev-commit --oneline
$__git_diff_common_options