summaryrefslogtreecommitdiffstats
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2015-06-18 23:47:40 +0200
committerOliver Kiddle <opk@zsh.org>2015-06-18 23:47:40 +0200
commit8ebb4e65a9b47d68b730ff02e70d9ba28d3ccd3f (patch)
tree732d88d4b627fdb05139efaf07aaff0d7ad171ca /Completion/Unix/Command
parent35521: sort matches numerically and use pfiles on Solaris (diff)
downloadzsh-8ebb4e65a9b47d68b730ff02e70d9ba28d3ccd3f.tar
zsh-8ebb4e65a9b47d68b730ff02e70d9ba28d3ccd3f.tar.gz
zsh-8ebb4e65a9b47d68b730ff02e70d9ba28d3ccd3f.tar.bz2
zsh-8ebb4e65a9b47d68b730ff02e70d9ba28d3ccd3f.tar.lz
zsh-8ebb4e65a9b47d68b730ff02e70d9ba28d3ccd3f.tar.xz
zsh-8ebb4e65a9b47d68b730ff02e70d9ba28d3ccd3f.tar.zst
zsh-8ebb4e65a9b47d68b730ff02e70d9ba28d3ccd3f.zip
35504: complete % placeholders for git log --format
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_git100
1 files changed, 90 insertions, 10 deletions
diff --git a/Completion/Unix/Command/_git b/Completion/Unix/Command/_git
index 088a7dbb7..3e728865b 100644
--- a/Completion/Unix/Command/_git
+++ b/Completion/Unix/Command/_git
@@ -6269,6 +6269,95 @@ __git_setup_diff_stage_options () {
)
}
+(( $+functions[__git_format_placeholders] )) ||
+__git_format_placeholders() {
+ local sep
+ local -a disp names placeholders expl
+ if compset -P 'format:'; then
+ compset -P '(%[^acgCG]|%?[^%]|[^%])#'
+ if compset -P '%C'; then
+ _wanted colors expl color compadd reset red green blue
+ return
+ fi
+ if [[ -prefix %G ]]; then
+ placeholders=(
+ 'GG:raw verification message'
+ 'G?:indicate [G]ood, [B]ad, [U]ntrusted or [N]o signature'
+ 'GS:name of signer'
+ 'GK:signing key'
+ )
+ disp=( -l )
+ elif [[ -prefix %g ]]; then
+ placeholders=(
+ gD:'reflog selector'
+ gd:'short reflog selector'
+ gn:'reflog identity'
+ gs:'reflog subject'
+ )
+ disp=( -l )
+ elif [[ $PREFIX = (#b)%([ac]) ]]; then
+ placeholders=(
+ n:'name'
+ N:'name (use .mailmap)'
+ e:'email'
+ E:'email (use .mailmap)'
+ d:'date'
+ D:'date, RFC2822 style'
+ r:'date, relative'
+ t:'date, UNIX timestamp'
+ i:'date, like ISO 8601'
+ I:'date, strict ISO 8601'
+ )
+ placeholders=( $match[1]$^placeholders )
+ else