1 # git-cola extensions for Git's git-completion.bash script
3 # This script must be sourced *after* Git's git-completion.bash script.
4 # Source git.git's git-completion.bash and then source this script from
5 # your ~/.bashrc in order to activate the completions.
7 # Completion is provided for "git cola ..." and "git dag ..." via the
8 # _git_cola() and _git_dag() functions.
9 # See git.git's contrib/completion/git-completion.bash for more details.
11 __git_cola_common_options
="--icon-theme --prompt --repo --theme --version"
12 __git_cola_subcommands_list
=
14 __git_cola_common_opts
() {
15 __gitcomp
"$__git_cola_common_options $1"
19 __git_has_doubledash
&& return
21 if test -z "$__git_cola_subcommands_list"
23 __git_cola_subcommands_list
=$
(
24 git cola
--help-commands |
30 local subcommand
=$
(__git_find_on_cmdline
"$__git_cola_subcommands_list")
38 if test -z "$subcommand"
41 $__git_cola_subcommands_list
42 $__git_cola_common_options
59 __git_complete_revlist
60 __git_cola_common_opts
66 __git_cola_common_opts
--rebase
74 __gitcomp
"nowarn warn fix error error-all"
78 __gitcomp
"resolve recursive octopus ours subtree"
82 __gitcomp
"ours theirs patience
83 diff-algorithm=patience
84 diff-algorithm=minimal
85 diff-algorithm=histogram
99 __git_complete_revlist
100 __git_cola_common_opts
"
104 --committer-date-is-author-date
138 __git_complete_revlist
143 __git_cola_common_opts
149 __git_has_doubledash
&& return
151 if test "$prev" = "--max-count"
155 __git_cola_common_opts
--max-count
156 __git_complete_revlist