mirror of
https://github.com/neovim/neovim.git
synced 2026-08-04 06:38:44 +00:00
build(vim-patch): detect N/A tags in vimhelp patches #40942
Vim patches for Vim help files must use Vim tags as diff hunk header to reliably detect if a hunk is N/A or not. Git does not know which files are Vim help files so that it can use custom "diff.<filetype>.xfuncname" regexp to create the header. Update Neovim's gitattributes to detect Vim help files and then use it on vim-patch.sh to scan Vim patches. Add non-function tags from ":h vim_diff" to detect N/A Vim runtime patches.
This commit is contained in:
@@ -927,9 +927,11 @@ is_na_patch() {
|
||||
for file in $FILES_REMAINING; do
|
||||
case ${file} in
|
||||
runtime/doc/*.txt | runtime/pack/dist/opt/*/doc/*.txt)
|
||||
HUNKS=$(git -C "${VIM_SOURCE_DIR}" diff-tree --no-commit-id -r -b -U0 \
|
||||
HUNKS=$(git -c core.attributesfile="$NVIM_SOURCE_DIR"/.gitattributes -c 'diff.helphelp.xfuncname=^.*\*[.a-zA-Z0-9\-]+\*$' -C "${VIM_SOURCE_DIR}" \
|
||||
diff-tree --no-commit-id -r -b -U0 \
|
||||
'-I\*\s+For Vim version [0-9]\.[0-9]\.\s+Last change: [0-9]+ [A-Z][a-z]+ [0-9]+' \
|
||||
'-I compiled \(with\|without\) .*(\|.*\|) feature\.$' \
|
||||
'-I^=+$' \
|
||||
"$patch" -- "${file}" |
|
||||
grep -v -e '{.\+ \(available\|compiled\) \(with\|without\) .\+}' |
|
||||
grep -Pzo '(?<=\n)@@ -[0-9][^@\n]+\+[0-9][^@\n]* @@[^@\n]*\n(?=([-+][^\n]*\n)+(@|$))' |
|
||||
|
||||
Reference in New Issue
Block a user