diff options
| author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2026-10-03 23:28:46 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-10-04 11:28:46 +0800 |
| commit | fb1f321b0efb31101891ec6cc93d4087bc4ee325 (patch) | |
| tree | 31dd1dfec0ef3467b17d3cdfedbb1bf1467f38fa /scripts/vim-patch.sh | |
| parent | f76c1ca25a6cba0a0e2cbb916e14995bd7f987b3 (diff) | |
| download | rneovim-fb1f321b0efb31101891ec6cc93d4087bc4ee325.tar.gz rneovim-fb1f321b0efb31101891ec6cc93d4087bc4ee325.tar.bz2 rneovim-fb1f321b0efb31101891ec6cc93d4087bc4ee325.zip | |
build(vim-patch.sh): -L,-l works for 1 file (#42227)
https://github.com/neovim/neovim/pull/42121 broke "-L" and "-l"
for commits specific to 1 file
because majority of Vim commits are tagged
and "git log --tags --no-walk" is inconsistent for 1-file queries.
"git log --stdin --no-walk" does work so it's always required
regardless of additional formatting.
----
Tags v9.0.0055 and v9.0.0056 are on the same commit.
Detecting 1 of the tags resolves the other for "-L" and "-l".
Patch 9.0.0056 is N/A based on
commit e15f79c659f8895afdb946333757ad5517329805 .
vim-patch.sh can't auto-detect v9.0.0056 yet.
----
TODO
Prevent developer from overwriting essential "--format=" flags
else vim-patch.sh produces invalid Git refs.
Diffstat (limited to 'scripts/vim-patch.sh')
| -rwxr-xr-x | scripts/vim-patch.sh | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index 7293a58fea..1580ef72aa 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -626,10 +626,13 @@ list_missing_vimpatches() { VIM_VERSION_0_DATE=2018-05-17:15:00:00Z local extended_format=$1; shift + + # XXX(@janlazo): Delimiter "%x00" required to detect tagged commits + # https://git-scm.com/docs/git-log#Documentation/git-log.txt-x00 if [[ "$extended_format" == 1 ]]; then - git_log_format="%s" + git_log_format="%H%x00%d%x00: %s" else - git_log_format="" + git_log_format="%H%x00%(decorate:prefix=,suffix=,tag=)" fi # Massage arguments for git-log. @@ -649,20 +652,15 @@ list_missing_vimpatches() { git_log_args+=("$i") done - missing_numbers=$(_git -C "${VIM_SOURCE_DIR}" log --decorate-refs='refs/tags/*' --reverse --since="${VIM_VERSION_0_DATE}" --no-walk --tags --format='%(decorate:prefix=,suffix=,tag=)' "${git_log_args[@]}" | + missing_numbers=$(_git -C "${VIM_SOURCE_DIR}" log --decorate-refs='refs/tags/*' --reverse --since="${VIM_VERSION_0_DATE}" --no-walk --tags --format='%(decorate:prefix=,suffix=,tag=)' | grep -v -F -f <(list_vimpatch_numbers) | - sed -E 's/,.*$//') - missing_hashes=$(_git -C "${VIM_SOURCE_DIR}" log --decorate-refs='refs/tags/*' --reverse --since="${VIM_VERSION_0_DATE}" --format='%H%D' "${git_log_args[@]}" | + grep -oE 'v[0-9]+\.[0-9]+\.[0-9]{4}') + missing_hashes=$(_git -C "${VIM_SOURCE_DIR}" log --decorate-refs='refs/tags/*' --reverse --since="${VIM_VERSION_0_DATE}" --format='%H%D' | grep -v -e 'tag:' | grep -v -f <(list_vimpatch_hashes | sed -E 's/(.*)/^\1/')) - if test -n "${git_log_format}"; then - (echo "${missing_numbers}"; echo "${missing_hashes}") | - _git --no-pager -C "${VIM_SOURCE_DIR}" log --decorate-refs='refs/tags/*' --reverse --no-walk --stdin --format="%H%x00%d%x00: ${git_log_format}" | - awk -F '\0' '{ print $2 ? $2$3 : $1$3 }' - else - echo "${missing_numbers}" - echo "${missing_hashes}" - fi + (echo "${missing_numbers}"; echo "${missing_hashes}") | + _git --no-pager -C "${VIM_SOURCE_DIR}" log --decorate-refs='refs/tags/*' --reverse --no-walk --stdin --format="${git_log_format}" "${git_log_args[@]}" | + awk -F '\0' '{ print $2 ? $2$3 : $1$3 }' } # Prints a human-formatted list of Vim commits, with instructional messages. |