build(vim-patch): n/a docs from 9.0.1481, keep hunks without header

switch/case and goto labels v9.0.1481 and similar patches
from auto-N/A.
Blacklist as much as possible to auto-N/A later crypt patches.

Hunks without header in "*.h" is valid if only littered with #ifdefs
or change is isolated to 1st line
but "src/feature.h" should be mostly N/A
after Nvim removed "FEAT_" guards.
Wonder if certain patches with only "*.h" changes were mistakenly
marked N/A.
This commit is contained in:
Jan Edmund Lazo
2026-08-18 21:36:27 -04:00
parent 53211ade2b
commit a98858651e
2 changed files with 10 additions and 3 deletions

View File

@@ -942,7 +942,7 @@ is_na_patch() {
grep -Pzo '(?<=\n)@@ -[0-9][^@\n]+\+[0-9][^@\n]* @@[^@\n]*\n(?=([-+][^\n]*\n)+(@|$))' |
tr '\0' '\n')
if test -n "$HUNKS"; then
HUNK_NUM_FINAL=$(echo "$HUNKS" | sed 's/^@@ .* @@ \?//' | grep -cv -f "$NA_HUNKS_VIM")
HUNK_NUM_FINAL=$(echo "$HUNKS" | sed 's/^@@ .* @@ //' | grep -cv -f "$NA_HUNKS_VIM")
test "$HUNK_NUM_FINAL" -ne 0 && return 1
fi
;;
@@ -1000,7 +1000,7 @@ is_na_patch() {
"$patch" -- "${file}" |
grep '^@@ .* @@')
if test -n "$HUNKS"; then
HUNK_NUM_FINAL=$(echo "$HUNKS" | sed 's/^@@ .* @@ \?//' | grep -cv -f "$NA_HUNKS_H")
HUNK_NUM_FINAL=$(echo "$HUNKS" | sed 's/^@@ .* @@ //' | grep -cv -f "$NA_HUNKS_H")
test "$HUNK_NUM_FINAL" -ne 0 && return 1
fi
;;
@@ -1019,16 +1019,18 @@ is_na_patch() {
'-I^\s*(static)?\s(char_u|hashtab_T|int|void)( \*)?$' \
'-I^static\s(char_u|hashtab_T|int|void)\s\*?[^*]+\(.+\);$' \
'-I#\s*define.*ex_ni$' \
'-I[.>]b_p_key' \
'-I[_.>]sc_version = ' \
'-I[_.>]uf_script_ctx_version = ' \
'-I = skip_type\(.+\);$' \
'-Icheck_typval_type\(.+\)' \
'-Icrypt_get_method_nr\(.+\)' \
'-I\spopup_set_firstline\(.+\);' \
'-I\svim_free\(.*w_popup_title\);' \
"$patch" -- "${file}" |
grep '^@@ .* @@')
if test -n "$HUNKS"; then
HUNK_NUM_FINAL=$(echo "$HUNKS" | sed 's/^@@ .* @@ \?//' | grep -cv -f "$NA_HUNKS_C")
HUNK_NUM_FINAL=$(echo "$HUNKS" | sed 's/^@@ .* @@ //' | grep -cv -f "$NA_HUNKS_C")
test "$HUNK_NUM_FINAL" -ne 0 && return 1
fi
;;