From a99f8989f7f32eb052b2dfcc5d18b7c6705c93ed Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 18 Jul 2026 10:35:18 -0400 Subject: [PATCH 1/3] build(vim-patch): alloc.c N/A functions Note this doesn't find new N/A patches by itself and this is to align with ':h dev-vimpatch'. I use the 'vim_na_*' files to debug the filtered diff of files that seem N/A but contain relevant code. I can't blacklist the entire file. --- scripts/vim_na_hunks_c.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/vim_na_hunks_c.txt b/scripts/vim_na_hunks_c.txt index 4b216359db..4bd445e935 100644 --- a/scripts/vim_na_hunks_c.txt +++ b/scripts/vim_na_hunks_c.txt @@ -40,7 +40,13 @@ ^f_test_settime( ^f_test_srand_seed( ^f_test_void( +^l\?alloc(size_t +^l\?alloc[a-zA-Z0-9_]\+(size_t +^mem_[a-zA-Z0-9_]\+( ^static int included_patches\[\] = +^vim_free( +^vim_mem_profile_dump( +^vim_memset( _balloon[a-zA-Z0-9_]\+( _tabpanelopt( bevalterm[a-zA-Z0-9_]\+( From 277cb1b431b3d1a6fc18132dd3d879747914379f Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 18 Jul 2026 15:09:55 -0400 Subject: [PATCH 2/3] build(vim-patch): "vim_" char/string N/A funcs Note this doesn't find new N/A patches by itself and this is to align with ':h dev-vimpatch'. Neovim refactored Vim's "char/string" functions to be either safer (ie. xstrlcat) or target Unicode. --- scripts/vim_na_hunks_c.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/vim_na_hunks_c.txt b/scripts/vim_na_hunks_c.txt index 4bd445e935..ae684b2933 100644 --- a/scripts/vim_na_hunks_c.txt +++ b/scripts/vim_na_hunks_c.txt @@ -45,8 +45,16 @@ ^mem_[a-zA-Z0-9_]\+( ^static int included_patches\[\] = ^vim_free( +^vim_isNormalIDc( +^vim_isalpha( +^vim_islower( +^vim_isupper( ^vim_mem_profile_dump( ^vim_memset( +^vim_strcat( +^vim_strncpy( +^vim_tolower( +^vim_toupper( _balloon[a-zA-Z0-9_]\+( _tabpanelopt( bevalterm[a-zA-Z0-9_]\+( From 9536d35099f48bc5eeda63fe0be8bd9c8bd6b4ad Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Sat, 18 Jul 2026 16:05:38 -0400 Subject: [PATCH 3/3] build(vim-patch): ignore amount of whitespace change Patch 9.1.1363 is N/A after ignoring whitespace. ----- Unrelated N/A patches vim-patch:8.1.1985: code for dealing with paths is spread out https://github.com/neovim/neovim/pull/36125#issuecomment-5012670153 --- scripts/vim-patch.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 55c80efe13..9942131b74 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -912,26 +912,26 @@ is_na_patch() { local NA_HUNKS_C="$NVIM_SOURCE_DIR/scripts/vim_na_hunks_c.txt" local FILES_REMAINING HUNKS HUNK_NUM_FINAL RT_NUMSTAT RT_TITLE_PAT RT_TITLE_NUM - FILES_REMAINING="$(diff <(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id --name-only -r "$patch" | grep -v -f "$NA_REGEXP") "$NA_FILELIST" | + FILES_REMAINING="$(diff <(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id -r -b --name-only "$patch" | grep -v -f "$NA_REGEXP") "$NA_FILELIST" | grep '^<' | sed 's/^< //')" || true test -z "$FILES_REMAINING" && return 0 for file in $FILES_REMAINING; do case ${file} in runtime/doc/*.txt) - RT_NUMSTAT=$(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id --numstat -r "$patch" -- "${file}" | grep -c '^1\s\+1\s\+') + RT_NUMSTAT=$(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id -r -b --numstat "$patch" -- "${file}" | grep -c '^1\s\+1\s\+') test "${RT_NUMSTAT}" -ne 1 && return 1 RT_TITLE_PAT="\*$(basename "${file}")\*\s+For Vim version [0-9]\.[0-9]\.\s+Last change: [0-9]+ [A-Z][a-z]+ [0-9]+\n" - RT_TITLE_NUM="$(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id -U0 -r "$patch" -- "${file}" | + RT_TITLE_NUM="$(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id -r -b -U0 "$patch" -- "${file}" | grep -Pzc "@@\n-${RT_TITLE_PAT}\+${RT_TITLE_PAT}$")" || true test "$RT_TITLE_NUM" -ne 1 && return 1 ;; *.h) - HUNKS=$(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id -U0 -r '-I^#\s*(else|endif)' '-I^#\s*(ifdef|if.*defined\().*FEAT_' "$patch" -- "${file}") + HUNKS=$(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id -r -b -U0 '-I^#\s*(else|endif)' '-I^#\s*(ifdef|if.*defined\().*FEAT_' "$patch" -- "${file}") test -n "${HUNKS}" && return 1 ;; *.c) - HUNKS=$(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id -U0 -r '-I^#\s*(else|endif)' '-I^#\s*(ifdef|if.*defined\().*FEAT_' "$patch" -- "$file" | grep -P '^@@ .* @@') + HUNKS=$(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id -r -b -U0 '-I^#\s*(else|endif)' '-I^#\s*(ifdef|if.*defined\().*FEAT_' "$patch" -- "$file" | grep -P '^@@ .* @@') if test -n "$HUNKS"; then HUNK_NUM_FINAL=$(echo "$HUNKS" | sed 's/^@@ .* @@ \?//' | grep -cv -f "$NA_HUNKS_C") test "$HUNK_NUM_FINAL" -ne 0 && return 1