Merge branch 'pb/complete-commit-trailers'
The command-line complation support (in contrib/) learned to complete "git commit --trailer=" for possible trailer keys. * pb/complete-commit-trailers: completion: commit: complete trailers tokens more robustly completion: commit: complete configured trailer tokens
This commit is contained in:
@ -1677,6 +1677,11 @@ _git_clone ()
|
|||||||
|
|
||||||
__git_untracked_file_modes="all no normal"
|
__git_untracked_file_modes="all no normal"
|
||||||
|
|
||||||
|
__git_trailer_tokens ()
|
||||||
|
{
|
||||||
|
__git config --name-only --get-regexp '^trailer\..*\.key$' | cut -d. -f 2- | rev | cut -d. -f2- | rev
|
||||||
|
}
|
||||||
|
|
||||||
_git_commit ()
|
_git_commit ()
|
||||||
{
|
{
|
||||||
case "$prev" in
|
case "$prev" in
|
||||||
@ -1701,6 +1706,10 @@ _git_commit ()
|
|||||||
__gitcomp "$__git_untracked_file_modes" "" "${cur##--untracked-files=}"
|
__gitcomp "$__git_untracked_file_modes" "" "${cur##--untracked-files=}"
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
--trailer=*)
|
||||||
|
__gitcomp_nl "$(__git_trailer_tokens)" "" "${cur##--trailer=}" ":"
|
||||||
|
return
|
||||||
|
;;
|
||||||
--*)
|
--*)
|
||||||
__gitcomp_builtin commit
|
__gitcomp_builtin commit
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user