diff options
| author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2026-07-17 07:16:31 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-17 07:16:31 -0400 |
| commit | 0d92bf376170dd6c311f1e7dfefb323e336ff8eb (patch) | |
| tree | de376efba61374fd32a11973342099bbcd0846a0 /scripts/vim-patch.sh | |
| parent | 58fe621cfcd94a3572c5934b100d801ba648bb8a (diff) | |
| download | rneovim-0d92bf376170dd6c311f1e7dfefb323e336ff8eb.tar.gz rneovim-0d92bf376170dd6c311f1e7dfefb323e336ff8eb.tar.bz2 rneovim-0d92bf376170dd6c311f1e7dfefb323e336ff8eb.zip | |
build(vim-patch): '#ifdef FEAT_' tweaking is N/A #40785
Filter out `#ifdef` line changes when analyzing C files (*.c, *.h)
via git "-I" flag.
```
-I<regex>
--ignore-matching-lines=<regex>
Ignore changes whose all lines match <regex>. This option may be specified more than once.
```
- https://git-scm.com/docs/diff-options#Documentation/diff-options.txt--Iregex
Diffstat (limited to 'scripts/vim-patch.sh')
| -rwxr-xr-x | scripts/vim-patch.sh | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index a69c3a9386..55c80efe13 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -926,8 +926,12 @@ is_na_patch() { 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}") + test -n "${HUNKS}" && return 1 + ;; *.c) - HUNKS=$(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id -U0 -r "$patch" -- "$file" | grep -P '^@@ .* @@') + 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 '^@@ .* @@') 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 |