mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 13:15:09 -07:00
scripts/vim-patch.sh: massage args for git-log [ci skip] (#10888)
Replace "src/nvim/" => "src/". Replace ".*/.vim-src/" => "". This allows to use tab completion based on existing files in Neovim's source, or via .vim-src. Previously you would have to typically remove the "nvim/" part manually yourself.
This commit is contained in:
parent
dd025a18c1
commit
e03a4f965e
@ -394,6 +394,22 @@ list_missing_vimpatches() {
|
|||||||
local token vim_commit vim_tag patch_number
|
local token vim_commit vim_tag patch_number
|
||||||
declare -A tokens
|
declare -A tokens
|
||||||
declare -A vim_commit_tags
|
declare -A vim_commit_tags
|
||||||
|
declare -a git_log_args
|
||||||
|
|
||||||
|
# Massage arguments for git-log.
|
||||||
|
declare -A git_log_replacements=(
|
||||||
|
[^\(.*/\)?src/nvim/\(.*\)]="\${BASH_REMATCH[1]}src/\${BASH_REMATCH[2]}"
|
||||||
|
[^\(.*/\)?\.vim-src/\(.*\)]="\${BASH_REMATCH[2]}"
|
||||||
|
)
|
||||||
|
for i in "$@"; do
|
||||||
|
for j in "${!git_log_replacements[@]}"; do
|
||||||
|
if [[ "$i" =~ $j ]]; then
|
||||||
|
eval "git_log_args+=(${git_log_replacements[$j]})"
|
||||||
|
continue 2
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
git_log_args+=("$i")
|
||||||
|
done
|
||||||
|
|
||||||
# Find all "vim-patch:xxx" tokens in the Nvim git log.
|
# Find all "vim-patch:xxx" tokens in the Nvim git log.
|
||||||
for token in $(list_vimpatch_tokens); do
|
for token in $(list_vimpatch_tokens); do
|
||||||
@ -414,7 +430,7 @@ list_missing_vimpatches() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Get missing Vim commits
|
# Get missing Vim commits
|
||||||
for vim_commit in $(list_vim_commits "$@"); do
|
for vim_commit in $(list_vim_commits "${git_log_args[@]}"); do
|
||||||
# Check for vim-patch:<commit_hash> (usually runtime updates).
|
# Check for vim-patch:<commit_hash> (usually runtime updates).
|
||||||
token="vim-patch:${vim_commit:0:7}"
|
token="vim-patch:${vim_commit:0:7}"
|
||||||
if [[ "${tokens[$token]-}" ]]; then
|
if [[ "${tokens[$token]-}" ]]; then
|
||||||
@ -436,6 +452,7 @@ list_missing_vimpatches() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Prints a human-formatted list of Vim commits, with instructional messages.
|
# Prints a human-formatted list of Vim commits, with instructional messages.
|
||||||
|
# Passes "$@" onto list_missing_vimpatches (args for git-log).
|
||||||
show_vimpatches() {
|
show_vimpatches() {
|
||||||
get_vim_sources
|
get_vim_sources
|
||||||
printf "\nVim patches missing from Neovim:\n"
|
printf "\nVim patches missing from Neovim:\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user