1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-26 16:40:29 +01:00

38961: _git-config: No functional change: rename $git_options_static to $git_options in preparation for the after-next commit.

This commit is contained in:
Daniel Shahaf 2016-07-29 17:00:06 +00:00
parent 9ef02744dd
commit 0782e0a0a6
2 changed files with 18 additions and 12 deletions

View file

@ -1,3 +1,9 @@
2016-08-01 Daniel Shahaf <d.s@daniel.shahaf.name>
* 38961: Completion/Unix/Command/_git: _git-config: No functional
change: rename $git_options_static to $git_options in preparation
for the after-next commit.
2016-07-31 Daniel Shahaf <d.s@daniel.shahaf.name> 2016-07-31 Daniel Shahaf <d.s@daniel.shahaf.name>
* unposted: Completion/Unix/Command/_git: Clean up superfluous * unposted: Completion/Unix/Command/_git: Clean up superfluous

View file

@ -1959,8 +1959,8 @@ _git-config () {
# TODO: Add support for merge.*. (merge driver), diff.*. (diff driver), and filter.*. (filter driver) options # TODO: Add support for merge.*. (merge driver), diff.*. (diff driver), and filter.*. (filter driver) options
# (see gitattributes(5)). # (see gitattributes(5)).
# TODO: .path options should take absolute paths. # TODO: .path options should take absolute paths.
declare -a git_options_static declare -a git_options
git_options_static=( git_options=(
advice.pushNonFastForward:'show advice when git push refuses non-fast-forward refs::->bool:true' advice.pushNonFastForward:'show advice when git push refuses non-fast-forward refs::->bool:true'
advice.pushUpdateRejected:'combined setting for advice.push*::->bool:true' advice.pushUpdateRejected:'combined setting for advice.push*::->bool:true'
advice.pushNonFFCurrent:'show advice when git push fails due to a non-fast-forward update to the current branch::->bool:true' advice.pushNonFFCurrent:'show advice when git push fails due to a non-fast-forward update to the current branch::->bool:true'
@ -2474,10 +2474,10 @@ _git-config () {
if compset -P '[^.]##.*.'; then if compset -P '[^.]##.*.'; then
declare -a match mbegin mend declare -a match mbegin mend
# When completing 'remote.foo.<TAB>', offer 'bar' if $git_options_static contains 'remote.foo.bar'. # When completing 'remote.foo.<TAB>', offer 'bar' if $git_options contains 'remote.foo.bar'.
options+=(${${${${(M)git_options_static:#(#i)${IPREFIX}[^.:]##:*}#(#i)${IPREFIX}}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]}) options+=(${${${${(M)git_options:#(#i)${IPREFIX}[^.:]##:*}#(#i)${IPREFIX}}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]})
# When completing 'remote.foo.<TAB>', offer 'bar' if $git_options_static contains 'remote.*.bar'. # When completing 'remote.foo.<TAB>', offer 'bar' if $git_options contains 'remote.*.bar'.
options+=(${${${${(M)git_options_static:#(#i)${IPREFIX%%.*}.\*.[^.:]##:*}#(#i)${IPREFIX%%.*}.\*.}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]}) options+=(${${${${(M)git_options:#(#i)${IPREFIX%%.*}.\*.[^.:]##:*}#(#i)${IPREFIX%%.*}.\*.}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]})
declare -a labels declare -a labels
labels=( labels=(
@ -2511,8 +2511,8 @@ _git-config () {
elif compset -P '[^.]##.'; then elif compset -P '[^.]##.'; then
local opt local opt
declare -a match mbegin mend declare -a match mbegin mend
for opt in ${${${${(M)git_options_static:#(#i)${IPREFIX}[^.:]##:*}#(#i)${IPREFIX}}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]}; do for opt in ${${${${(M)git_options:#(#i)${IPREFIX}[^.:]##:*}#(#i)${IPREFIX}}/#(#b)([^:]##:)([^\\:]#(\\?[^\\:]#)#:[^\\:]#(\\?[^\\:]#)#:->bool)/$match[1]whether or not to $match[2]}/#(#b)([^:]##:([^\\:]#(\\?[^\\:]#)#))*/$match[1]}; do
if (( ${git_options_static[(I)${opt%%:*}.*]} )); then if (( ${git_options[(I)${opt%%:*}.*]} )); then
sections_and_options+=$opt sections_and_options+=$opt
else else
options+=$opt options+=$opt
@ -2702,13 +2702,13 @@ _git-config () {
esac esac
local z=$'\0' local z=$'\0'
# Set $parts to the $git_options_static element that corresponds to $line[1] # Set $parts to the $git_options element that corresponds to $line[1]
# (the option name whose value is currently being completed). The elements # (the option name whose value is currently being completed). The elements
# of $parts are the colon-separated elements of the $git_options_static element. # of $parts are the colon-separated elements of the $git_options element.
declare -a parts declare -a parts
parts=("${(S@0)${git_options_static[(r)(#i)${line[1]}:*]}//(#b)(*[^\\]|):/$match[1]$z}") parts=("${(S@0)${git_options[(r)(#i)${line[1]}:*]}//(#b)(*[^\\]|):/$match[1]$z}")
if (( $#parts < 2 )) && [[ $line[1] == [^.]##.*.[^.]## ]]; then if (( $#parts < 2 )) && [[ $line[1] == [^.]##.*.[^.]## ]]; then
parts=("${(S@0)${git_options_static[(r)(#i)${line[1]%%.*}.\*.${line[1]##*.}:*]}//(#b)(*[^\\]|):/$match[1]$z}") parts=("${(S@0)${git_options[(r)(#i)${line[1]%%.*}.\*.${line[1]##*.}:*]}//(#b)(*[^\\]|):/$match[1]$z}")
fi fi
(( $#parts >= 4 )) || return ret (( $#parts >= 4 )) || return ret