mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
vim-patch.sh: always use git log, not version.c
This commit is contained in:
@@ -327,6 +327,11 @@ list_vim_patches() {
|
||||
get_vim_sources
|
||||
|
||||
printf "\nVim patches missing from Neovim:\n"
|
||||
|
||||
# Get missing Vim commits
|
||||
local vim_commits
|
||||
vim_commits="$(cd "${VIM_SOURCE_DIR}" && git log --reverse --format='%H' v8.0.0000..HEAD)"
|
||||
|
||||
# Find all "vim-patch:xxx" tokens in the Nvim git log.
|
||||
local tokens
|
||||
tokens="$(cd "${NVIM_SOURCE_DIR}" && git log -E --grep='vim-patch:[^ ]+' | grep 'vim-patch')"
|
||||
@@ -334,22 +339,21 @@ list_vim_patches() {
|
||||
|
||||
local vim_commit
|
||||
for vim_commit in ${vim_commits}; do
|
||||
local is_missing
|
||||
local vim_tag
|
||||
# This fails for untagged commits (e.g., runtime file updates) so mask the return status
|
||||
vim_tag="$(cd "${VIM_SOURCE_DIR}" && git describe --tags --exact-match "${vim_commit}" 2>/dev/null)" || true
|
||||
if [[ -n "${vim_tag}" ]]; then
|
||||
local is_missing
|
||||
local vim_tag
|
||||
# This fails for untagged commits (e.g., runtime file updates) so mask the return status
|
||||
vim_tag="$(cd "${VIM_SOURCE_DIR}" && git describe --tags --exact-match "${vim_commit}" 2>/dev/null)" || true
|
||||
patch_number="$(echo ${patch_number} | sed 's/^0*//g')" # Remove prefix "0"
|
||||
# Tagged Vim patch, check version.c:
|
||||
if [[ -n "${vim_tag}" ]]; then
|
||||
# Vim version number (not commit hash).
|
||||
local patch_number="${vim_tag:1}" # "v7.4.0001" => "7.4.0001"
|
||||
is_missing="$(echo "$tokens" | >/dev/null 2>&1 grep "vim\-patch:${patch_number}" && echo false || echo true)"
|
||||
vim_commit="${vim_tag#v}"
|
||||
if ! [ "$is_missing" = "false" ] ; then
|
||||
vim_commit="${vim_tag#v}"
|
||||
if (cd "${VIM_SOURCE_DIR}" && git --no-pager show --color=never --name-only "v${vim_commit}" 2>/dev/null) | grep -q ^runtime; then
|
||||
vim_commit="${vim_commit} (+runtime)"
|
||||
if (cd "${VIM_SOURCE_DIR}" && git --no-pager show --color=never --name-only "v${vim_commit}" 2>/dev/null) | grep -q ^runtime; then
|
||||
vim_commit="${vim_commit} (+runtime)"
|
||||
fi
|
||||
fi
|
||||
# Untagged Vim patch (e.g. runtime updates), check the Neovim git log:
|
||||
else
|
||||
# Untagged Vim patch (e.g. runtime updates).
|
||||
is_missing="$(echo "$tokens" | >/dev/null 2>&1 grep "vim\-patch:${vim_commit:0:7}" && echo false || echo true)"
|
||||
fi
|
||||
|
Reference in New Issue
Block a user