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>
Kir Kolyshkin committed
Feb 21, 2020 at 12:15 UTC
fd0bc175576d74faf5c7bfe626c09cfea884cc6a
1 file changed
+15
contrib/completion/git-completion.bash
+15
@@ -1470,9 +1470,16 @@ __git_diff_algorithms="myers minimal patience histogram"
1470
1471
__git_diff_submodule_formats="diff log short"
1472
1473
+__git_color_moved_opts="no default plain blocks zebra dimmed-zebra"
1474
+
1475
+__git_color_moved_ws_opts="no ignore-space-at-eol ignore-space-change
1476
+ ignore-all-space allow-indentation-change"
1477
+
1478
__git_diff_common_options="--stat --numstat --shortstat --summary
1479
--patch-with-stat --name-only --name-status --color
1480
--no-color --color-words --no-renames --check
1481
+ --color-moved --color-moved= --no-color-moved
1482
+ --color-moved-ws= --no-color-moved-ws
1483
--full-index --binary --abbrev --diff-filter=
1484
--find-copies-harder --ignore-cr-at-eol
1485
--text --ignore-space-at-eol --ignore-space-change
@@ -1503,6 +1510,14 @@ _git_diff ()
1510
__gitcomp "$__git_diff_submodule_formats" "" "${cur##--submodule=}"
1511
return
1512
;;
1513
+ --color-moved=*)
1514
+ __gitcomp "$__git_color_moved_opts" "" "${cur##--color-moved=}"
1515
+ return
1516
+ ;;
1517
+ --color-moved-ws=*)
1518
+ __gitcomp "$__git_color_moved_ws_opts" "" "${cur##--color-moved-ws=}"
1519
+ return
1520
+ ;;
1521
--*)
1522
__gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
1523
--base --ours --theirs --no-index