completion: commit: complete configured trailer tokens
commitc7153fad2d7e11b28d1cde21db040f8accae1900
authorPhilippe Blain <levraiphilippeblain@gmail.com>
Thu, 7 Sep 2023 17:42:31 +0000 (7 17:42 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 7 Sep 2023 19:37:07 +0000 (7 12:37 -0700)
tree36d327832c10fb2e252f074363132e12d1e2eacf
parent1fc548b2d6a3596f3e1c1f8b1930d8dbd1e30bf3
completion: commit: complete configured trailer tokens

Since 2daae3d1d1 (commit: add --trailer option, 2021-03-23), 'git
commit' can add trailers to commit messages. To make that feature more
pleasant to use at the command line, update the Bash completion code to
offer configured trailer tokens.

Add a __git_trailer_tokens function to list the configured trailers
tokens, and use it in _git_commit to suggest the configured tokens,
suffixing the completion words with ':' so that the user only has to add
the trailer value.

Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash