* [PATCH] completion: add diff --color-moved and config diff.colorMoved
@ 2018-05-10 9:06 John Marshall
0 siblings, 0 replies; only message in thread
From: John Marshall @ 2018-05-10 9:06 UTC (permalink / raw)
To: git; +Cc: John Marshall
Complete the --color-moved option wherever we complete --diff-algorithm.
Signed-off-by: John Marshall <John.W.Marshall@glasgow.ac.uk>
---
Complete this recently-added option in a slightly over-the-top number of
places. Patch based on the maint branch.
Cheers,
John
contrib/completion/git-completion.bash | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index b09c8a236..4e09aebd0 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1383,9 +1383,12 @@ __git_diff_algorithms="myers minimal patience histogram"
__git_diff_submodule_formats="diff log short"
+__git_diff_colormoveds="no default plain zebra dimmed_zebra"
+
__git_diff_common_options="--stat --numstat --shortstat --summary
- --patch-with-stat --name-only --name-status --color
- --no-color --color-words --no-renames --check
+ --patch-with-stat --name-only --name-status
+ --color --no-color --color-moved --no-color-moved
+ --color-words --no-renames --check
--full-index --binary --abbrev --diff-filter=
--find-copies-harder --ignore-cr-at-eol
--text --ignore-space-at-eol --ignore-space-change
@@ -1406,6 +1409,10 @@ _git_diff ()
__git_has_doubledash && return
case "$cur" in
+ --color-moved=*)
+ __gitcomp "$__git_diff_colormoveds" "" "${cur##--color-moved=}"
+ return
+ ;;
--diff-algorithm=*)
__gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}"
return
@@ -1702,6 +1709,10 @@ _git_log ()
__gitcomp "full short no" "" "${cur##--decorate=}"
return
;;
+ --color-moved=*)
+ __gitcomp "$__git_diff_colormoveds" "" "${cur##--color-moved=}"
+ return
+ ;;
--diff-algorithm=*)
__gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}"
return
@@ -2165,6 +2176,10 @@ _git_config ()
"
return
;;
+ diff.color[Mm]oved)
+ __gitcomp "false true $__git_diff_colormoveds"
+ return
+ ;;
diff.submodule)
__gitcomp "log short"
return
@@ -2393,6 +2408,7 @@ _git_config ()
credential.username
credentialCache.ignoreSIGHUP
diff.autorefreshindex
+ diff.colorMoved
diff.external
diff.ignoreSubmodules
diff.mnemonicprefix
@@ -2741,6 +2757,10 @@ _git_show ()
" "" "${cur#*=}"
return
;;
+ --color-moved=*)
+ __gitcomp "$__git_diff_colormoveds" "" "${cur##--color-moved=}"
+ return
+ ;;
--diff-algorithm=*)
__gitcomp "$__git_diff_algorithms" "" "${cur##--diff-algorithm=}"
return
--
2.17.0
[University of Glasgow: The Times Scottish University of the Year 2018]
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2018-05-10 9:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-10 9:06 [PATCH] completion: add diff --color-moved and config diff.colorMoved John Marshall
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).