mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +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
|
get_vim_sources
|
||||||
|
|
||||||
printf "\nVim patches missing from Neovim:\n"
|
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.
|
# Find all "vim-patch:xxx" tokens in the Nvim git log.
|
||||||
local tokens
|
local tokens
|
||||||
tokens="$(cd "${NVIM_SOURCE_DIR}" && git log -E --grep='vim-patch:[^ ]+' | grep 'vim-patch')"
|
tokens="$(cd "${NVIM_SOURCE_DIR}" && git log -E --grep='vim-patch:[^ ]+' | grep 'vim-patch')"
|
||||||
@@ -334,22 +339,21 @@ list_vim_patches() {
|
|||||||
|
|
||||||
local vim_commit
|
local vim_commit
|
||||||
for vim_commit in ${vim_commits}; do
|
for vim_commit in ${vim_commits}; do
|
||||||
local is_missing
|
local is_missing
|
||||||
local vim_tag
|
local vim_tag
|
||||||
# This fails for untagged commits (e.g., runtime file updates) so mask the return status
|
# 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
|
|
||||||
vim_tag="$(cd "${VIM_SOURCE_DIR}" && git describe --tags --exact-match "${vim_commit}" 2>/dev/null)" || true
|
vim_tag="$(cd "${VIM_SOURCE_DIR}" && git describe --tags --exact-match "${vim_commit}" 2>/dev/null)" || true
|
||||||
|
if [[ -n "${vim_tag}" ]]; then
|
||||||
# Vim version number (not commit hash).
|
# Vim version number (not commit hash).
|
||||||
local patch_number="${vim_tag:1}" # "v7.4.0001" => "7.4.0001"
|
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)"
|
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
|
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
|
||||||
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)"
|
||||||
vim_commit="${vim_commit} (+runtime)"
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# Untagged Vim patch (e.g. runtime updates), check the Neovim git log:
|
else
|
||||||
# Untagged Vim patch (e.g. runtime updates).
|
# 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)"
|
is_missing="$(echo "$tokens" | >/dev/null 2>&1 grep "vim\-patch:${vim_commit:0:7}" && echo false || echo true)"
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user