From 03ec1b37d328dbbe47a161c79da873ee7add96c7 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Thu, 20 Aug 2026 20:55:48 -0400 Subject: [PATCH 1/2] fix(vim-patch): :redrawtabpanel regexp, delay grep on hunk Too many suggestions in https://github.com/neovim/neovim/commit/bcf116cc2f2f59e6c0f5ce5a644f832476f77384 Multi-line grep on the hunk contents before filtering by hunk header prevents vim-patch.sh from detecting v8.1.2195 and v8.1.2219 as N/A. Revisit multi-line parsing for `runtime/doc/*.txt` when Vim v9.2+ has new runtime/doc/ patches about features that require "has()/exists()" guards. --- scripts/vim-patch.sh | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index de6ed4a6b6..add2e41c3f 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -928,11 +928,12 @@ is_na_patch() { for file in $FILES_REMAINING; do case ${file} in runtime/doc/*.txt | runtime/pack/dist/opt/*/doc/*.txt) + # TODO(@janlazo): ignore (multi-line) phrases based on regexp '{.\+ \(available\|compiled\) \(with\|without\) .\+}' HUNKS=$(git -c core.attributesfile="$NVIM_SOURCE_DIR"/.gitattributes -c 'diff.helphelp.xfuncname=^.*\*[^*]+\*$' -C "${VIM_SOURCE_DIR}" \ diff-tree --no-commit-id -r -b -U0 \ '-I^\s+$' \ '-I^=+$' \ - '-I^\|:redrawtabpanel|' \ + '-I^\|:redrawtabpanel\|' \ '-I^\|popup_[_a-z]+\(\)\|' \ '-I^popup_[_a-z]+\(' \ '-I\*\s+For Vim version [0-9]\.[0-9]\.\s+Last change: [0-9]+ [A-Z][a-z]+ [0-9]+' \ @@ -940,12 +941,9 @@ is_na_patch() { '-I\|popup-windows\|' \ '-I\|tabpanel\|' \ '-I\spopup window\s' \ - "$patch" -- "${file}" | - grep -v -e '{.\+ \(available\|compiled\) \(with\|without\) .\+}' | - grep -Pzo '(?<=\n)@@ -[0-9][^@\n]+\+[0-9][^@\n]* @@[^@\n]*\n(?=([-+][^\n]*\n)+(@|$))' | - tr '\0' '\n') + "$patch" -- "${file}") if test -n "$HUNKS"; then - HUNK_NUM_FINAL=$(echo "$HUNKS" | sed 's/^@@ .* @@ //' | grep -cv -f "$NA_HUNKS_VIM") + HUNK_NUM_FINAL=$(echo "$HUNKS" | grep '^@@ .* @@' | sed 's/^@@ .* @@ //' | grep -cv -f "$NA_HUNKS_VIM") test "$HUNK_NUM_FINAL" -ne 0 && return 1 fi ;; @@ -1001,10 +999,9 @@ is_na_patch() { '-I\slist_T\s+\*w_popup_mask;' \ '-I\spopclose_T\sw_popup_close;' \ '-I\s\*?w_popup_prop_[_a-z]+;' \ - "$patch" -- "${file}" | - grep '^@@ .* @@') + "$patch" -- "${file}") if test -n "$HUNKS"; then - HUNK_NUM_FINAL=$(echo "$HUNKS" | sed 's/^@@ .* @@ //' | grep -cv -f "$NA_HUNKS_H") + HUNK_NUM_FINAL=$(echo "$HUNKS" | grep '^@@ .* @@' | sed 's/^@@ .* @@ //' | grep -cv -f "$NA_HUNKS_H") test "$HUNK_NUM_FINAL" -ne 0 && return 1 fi ;; @@ -1031,10 +1028,9 @@ is_na_patch() { '-Icrypt_get_method_nr\(.+\)' \ '-I\spopup_set_firstline\(.+\);' \ '-I\svim_free\(.*w_popup_title\);' \ - "$patch" -- "${file}" | - grep '^@@ .* @@') + "$patch" -- "${file}") if test -n "$HUNKS"; then - HUNK_NUM_FINAL=$(echo "$HUNKS" | sed 's/^@@ .* @@ //' | grep -cv -f "$NA_HUNKS_C") + HUNK_NUM_FINAL=$(echo "$HUNKS" | grep '^@@ .* @@' | sed 's/^@@ .* @@ //' | grep -cv -f "$NA_HUNKS_C") test "$HUNK_NUM_FINAL" -ne 0 && return 1 fi ;; From 39a7b685395db67dc7f8abafa32f14369ddc8a65 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Fri, 21 Aug 2026 22:42:45 -0400 Subject: [PATCH 2/2] feat(vim-patch): ignore vim-patch tokens from commit list Sort vimpatch_commit_ignore.txt based on "git log" order else "diff" fails to filter out reverted vim-patch tokens. Put latest commit to revert on top of file. --- scripts/vim-patch.sh | 12 +++++++----- scripts/vimpatch_commit_ignore.txt | 5 +++++ scripts/vimpatch_token_reverts.txt | 4 ---- 3 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 scripts/vimpatch_commit_ignore.txt delete mode 100644 scripts/vimpatch_token_reverts.txt diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index add2e41c3f..176c78c843 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -597,15 +597,17 @@ list_vimpatch_tokens() { # Filter reverted Vim tokens. list_vimpatch_numbers() { local patch_pat='(8\.[12]|9\.[0-9])\.[0-9]{1,4}' - diff "${NVIM_SOURCE_DIR}/scripts/vimpatch_token_reverts.txt" <( - _git -C "${NVIM_SOURCE_DIR}" log --format="%s%n%b" -E --grep="^[* ]*vim-patch:${patch_pat}" | + diff "${NVIM_SOURCE_DIR}/scripts/vimpatch_commit_ignore.txt" <( + _git -C "${NVIM_SOURCE_DIR}" log --format="%H" -E --grep="^[* ]*vim-patch:${patch_pat}" + ) | + grep -e '^> ' | + sed -e 's/^> //' | + _git -C "${NVIM_SOURCE_DIR}" log --no-walk --stdin --format="%s%n%b" | grep -oE "^[* ]*vim-patch:${patch_pat}" | sed -nEe 's/^[* ]*vim-patch:('"${patch_pat}"').*$/\1/p' | awk '{split($0, a, "."); printf "%d.%d.%04d\n", a[1], a[2], a[3]}' | sort | - uniq ) | - grep -e '^> ' | - sed -e 's/^> //' + uniq } declare -A tokens diff --git a/scripts/vimpatch_commit_ignore.txt b/scripts/vimpatch_commit_ignore.txt new file mode 100644 index 0000000000..9f5dc60d95 --- /dev/null +++ b/scripts/vimpatch_commit_ignore.txt @@ -0,0 +1,5 @@ +bcf116cc2f2f59e6c0f5ce5a644f832476f77384 +72bc6c5801867e8f99a87737a64c1713ceac1e01 +43c137c3d8473ab87b5dad5c4c2414dd1016f663 +89a9745a1a55dc9ffd0f8292735e45bae6c7b01e +910bbc3cca796f7fa941e0f6176cd0061de0e01c diff --git a/scripts/vimpatch_token_reverts.txt b/scripts/vimpatch_token_reverts.txt deleted file mode 100644 index e50f03fbb6..0000000000 --- a/scripts/vimpatch_token_reverts.txt +++ /dev/null @@ -1,4 +0,0 @@ -8.1.2294 -9.1.0055 -9.2.0405 -9.2.1731