1
0
mirror of https://github.com/git/git.git synced 2024-10-18 15:48:15 +02:00

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:
Junio C Hamano 2023-09-20 10:44:57 -07:00
commit e9dac4b86c

@ -1677,6 +1677,11 @@ _git_clone ()
__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 ()
{
case "$prev" in
@ -1701,6 +1706,10 @@ _git_commit ()
__gitcomp "$__git_untracked_file_modes" "" "${cur##--untracked-files=}"
return
;;
--trailer=*)
__gitcomp_nl "$(__git_trailer_tokens)" "" "${cur##--trailer=}" ":"
return
;;
--*)
__gitcomp_builtin commit
return