summaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorKir Kolyshkin <kolyshkin@gmail.com>2020-02-21 20:15:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-24 19:09:47 (GMT)
commitfd0bc175576d74faf5c7bfe626c09cfea884cc6a (patch)
tree34a4dd6bec7ebb12a8731e6d0a3ed9934971503a /contrib/completion
parentd0654dc308b0ba76dd8ed7bbb33c8d8f7aacd783 (diff)
downloadgit-fd0bc175576d74faf5c7bfe626c09cfea884cc6a.zip
git-fd0bc175576d74faf5c7bfe626c09cfea884cc6a.tar.gz
git-fd0bc175576d74faf5c7bfe626c09cfea884cc6a.tar.bz2
completion: add diff --color-moved[-ws]
These options are available since git v2.15, but somehow eluded from the completion script. Note that while --color-moved-ws= accepts comma-separated list of values, there is no (easy?) way to make it work with completion (see e.g. [1]). [1]: https://github.com/scop/bash-completion/issues/240 Acked-by: Matheus Tavares Bernardino <matheus.bernardino@usp.br> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
-rw-r--r--contrib/completion/git-completion.bash15
1 files changed, 15 insertions, 0 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index e4d9ff4..e3187c3 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1470,9 +1470,16 @@ __git_diff_algorithms="myers minimal patience histogram"
__git_diff_submodule_formats="diff log short"
+__git_color_moved_opts="no default plain blocks zebra dimmed-zebra"
+
+__git_color_moved_ws_opts="no ignore-space-at-eol ignore-space-change
+ ignore-all-space allow-indentation-change"
+
__git_diff_common_options="--stat --numstat --shortstat --summary
--patch-with-stat --name-only --name-status --color
--no-color --color-words --no-renames --check
+ --color-moved --color-moved= --no-color-moved
+ --color-moved-ws= --no-color-moved-ws
--full-index --binary --abbrev --diff-filter=
--find-copies-harder --ignore-cr-at-eol
--text --ignore-space-at-eol --ignore-space-change
@@ -1503,6 +1510,14 @@ _git_diff ()
__gitcomp "$__git_diff_submodule_formats" "" "${cur##--submodule=}"
return
;;
+ --color-moved=*)
+ __gitcomp "$__git_color_moved_opts" "" "${cur##--color-moved=}"
+ return
+ ;;
+ --color-moved-ws=*)
+ __gitcomp "$__git_color_moved_ws_opts" "" "${cur##--color-moved-ws=}"
+ return
+ ;;
--*)
__gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
--base --ours --theirs --no-index