mirror of
https://github.com/neovim/neovim.git
synced 2025-12-17 11:55:34 +00: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:
@@ -394,6 +394,22 @@ list_missing_vimpatches() {
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Prints a newline-delimited list of Vim commits, for use by scripts.
|
||||||
|
# "$@" is passed to list_vim_commits, as extra arguments to git-log.
|
||||||
|
list_missing_vimpatches() {
|
||||||
|
local token vim_commit vim_tag patch_number
|
||||||
|
declare -A tokens
|
||||||
|
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]})"
|
eval "git_log_args+=(${git_log_replacements[$j]})"
|
||||||
continue 2
|
continue 2
|
||||||
fi
|
fi
|
||||||
@@ -414,7 +430,7 @@ list_missing_vimpatches() {
|
|||||||
--shell)
|
--shell)
|
||||||
)"
|
)"
|
||||||
# Exit in case of errors from the above eval (empty vim_commit_tags).
|
# Exit in case of errors from the above eval (empty vim_commit_tags).
|
||||||
if ! (( "${#vim_commit_tags[@]}" )); then
|
if ! (( "${#vim_commit_tags[@]}" )); then
|
||||||
msg_err "Could not get Vim commits/tags."
|
msg_err "Could not get Vim commits/tags."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -436,6 +452,7 @@ list_missing_vimpatches() {
|
|||||||
fi
|
fi
|
||||||
echo "$vim_tag"
|
echo "$vim_tag"
|
||||||
else
|
else
|
||||||
|
echo "$vim_commit"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user