Skip to content

Commit fd0bc17

Browse files
kolyshkingitster
authored andcommitted
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]: scop/bash-completion#240 Acked-by: Matheus Tavares Bernardino <[email protected]> Signed-off-by: Kir Kolyshkin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d0654dc commit fd0bc17

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

contrib/completion/git-completion.bash

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1470,9 +1470,16 @@ __git_diff_algorithms="myers minimal patience histogram"
14701470

14711471
__git_diff_submodule_formats="diff log short"
14721472

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+
14731478
__git_diff_common_options="--stat --numstat --shortstat --summary
14741479
--patch-with-stat --name-only --name-status --color
14751480
--no-color --color-words --no-renames --check
1481+
--color-moved --color-moved= --no-color-moved
1482+
--color-moved-ws= --no-color-moved-ws
14761483
--full-index --binary --abbrev --diff-filter=
14771484
--find-copies-harder --ignore-cr-at-eol
14781485
--text --ignore-space-at-eol --ignore-space-change
@@ -1503,6 +1510,14 @@ _git_diff ()
15031510
__gitcomp "$__git_diff_submodule_formats" "" "${cur##--submodule=}"
15041511
return
15051512
;;
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+
;;
15061521
--*)
15071522
__gitcomp "--cached --staged --pickaxe-all --pickaxe-regex
15081523
--base --ours --theirs --no-index

0 commit comments

Comments
 (0)